jfreechart

Is there a way to update and display x y next to mouse pointer in jfreechart?

邮差的信 提交于 2019-12-13 02:06:53
问题 I would like to display the (x, y) location of the mouse pointer with respect the coordinate system of the current jfree chart. I would like to do this constantly even if the mouse pointer is not set on any part of the graph. I know I can activate the tooltip the way explained here but that displays the mouse location only if the mouse is on top of a graph point. How can I see the XYs all the time next to mouse pointer (tooltip or something)? 回答1: As shown here, the coordinates are in the

What are the steps to use Customiser Chart Class?

允我心安 提交于 2019-12-13 02:04:14
问题 I want to customised my charts in my reports (using jasperReport and iReport 4.0) ,this class minimise the scale ,how can I also add value on top of each bar and write the properity on X axis vertically because their are overlapping (look at the attach chart it's a mess)? this is the class: public class ChartCustomiser implements JRChartCustomizer{ @Override public void customize(JFreeChart jfc, JRChart jrc) { CategoryPlot plot = (CategoryPlot)jfc.getPlot(); ValueAxis verticalAxis = plot

Turning the second timeseries in a TimeseriesChart to a barchart

[亡魂溺海] 提交于 2019-12-13 01:21:27
问题 As the heading implies, I have a timeseries chart that displays two curves, each a TimeSeries, both part of the same TimeSeriesCollection. What I want to do is display the second TimeSeries as a barchart, but I want both TimeSeries still in the same chart. Is this possible? 回答1: Yes this is possible, look at the OverlaidXYPlotDemo1 and OverlaidXYPlotDemo2 charts in the sample demo application that you can run from the JFree site. If you purchase the documentation they will send you the actual

Could not initialize class org.jfree.chart.JFreeChart

女生的网名这么多〃 提交于 2019-12-13 01:14:13
问题 EDIT: Hi there i am using JBoss 7.1 Runtime Server and i have an Problem on my MAC when i build my Project and run it on localhost i get always an ERROR from the JFreeChart Library that it could not initialize. I'm using Maven to import all my Library's my repository's was: <repositories> <repository> <id>java.net2</id> <name>Repository hosting the jee6 artifacts</name> <url>http://download.java.net/maven/2</url> </repository> <repository> <id>JBoss repository</id> <url>https://repository

JFreeChart: no such method error despite having loaded the library

流过昼夜 提交于 2019-12-13 00:39:17
问题 I am using JFreeChart in a Java swing application. I did specify where the libraries are in my builder.xml file: <zipgroupfileset dir="../lib" includes="jfreechart-0.9.21.jar" /> <zipgroupfileset dir="../lib" includes="jcommon-1.0.8.jar" /> I imported those libraries; Eclipse doesn't show any compilation error. But I am getting this when I run the code: java.lang.NoSuchMethodError: org.jfree.data.xy.XYSeries.<init>(Ljava/lang/Comparable;)V Could someone please help me figure out what's going

Dynamically repaint ScatterPlot in jfreechart

与世无争的帅哥 提交于 2019-12-13 00:26:41
问题 I have a scatterplot which plots positions of agents. These positions change. I was wondering how can I repaint/redraw the scatterplot with the new positions my drawing method. I need to redraw in the updatePositions function. Is there any way to implement any listener for ScatterPlot? private ChartPanel createPanel() { JFreeChart jfreechart = ChartFactory.createScatterPlot( title, "", "", initPositions(),PlotOrientation.VERTICAL, true, true, false); XYPlot xyPlot = (XYPlot) jfreechart

How to do double domain crosshair using jFreeChart

被刻印的时光 ゝ 提交于 2019-12-12 23:49:34
问题 How can I implement the double domain cross-hairs for my jfreechart? Here is the requirement I need to honor. The image is photo edited to show my requirement. Thanks in advance 回答1: You can use a ValueMarker, as shown here. You'll need to set the dash attributes in your Stroke; DEFAULT_GRIDLINE_STROKE is an example. 来源: https://stackoverflow.com/questions/9321693/how-to-do-double-domain-crosshair-using-jfreechart

Setting currency format for labels of vertical axis in jFreeChart

泄露秘密 提交于 2019-12-12 20:22:40
问题 The essential of question is declared at the title. More details: I have the Time series chart, and vertical axis should has labels in currency format like this $100, 000, 000 $50, 000 ... Now I have the same labels, but without dollar sign and range delimiter. For horizontal axis I used this approach: DateAxis axis = (DateAxis) plot.getDomainAxis(); axis.setDateFormatOverride(new SimpleDateFormat("yyyy")); And it works. When I try to do similar ValueAxis valueAxis = (ValueAxis) plot

Formatting tooltip value with StandardXYToolTipGenerator

烂漫一生 提交于 2019-12-12 19:29:12
问题 In desktop Java project I used StandardXYToolTipGenerator for generating tooltips on chart. Renderer was configured as below: renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator("{0} - {2} ({1})",new SimpleDateFormat("HH:mm:ss"), NumberFormat.getNumberInstance())); Where {2} is value (example 1.149431) but when I am using NumberFormat it format itself and return value 1.149, I want get precisely rounding. How to get it? Any idea? I tried extend NumberFormat class, but method

How to add a JFreechart to a Panel?

孤街浪徒 提交于 2019-12-12 17:22:48
问题 I've tried looking for answers to get this working but haven't managed to do so and I am about to lose my mind so here goes my question. I've recently downloaded JFreeChart to create so charts and implement them in the GUI I had. Here's the GUI and the panel where I want to insert the graph (marked in white): reports1 http://www.freeimagehosting.net/newuploads/eff3r.png reports2 http://www.freeimagehosting.net/newuploads/v5sty.png I have used NetBeans editor to construct the GUI and a