jfreechart

Annotations on candlestick chart not working

删除回忆录丶 提交于 2020-01-20 08:31:11
问题 I'm trying to add annotations to a chart. It seems like it's added, since the size() of the plot's annotations list increases if I add one more. The problem is that it's not being displayed. OHLCDataset candles = createCandleDataset(); // Create chart chart = ChartFactory.createCandlestickChart( "mychart", "", "", candles, true); XYPlot plot = (XYPlot) chart.getPlot(); XYShapeAnnotation a1 = new XYShapeAnnotation( new Rectangle2D.Double(10.0, 20.0, 20.0, 30.0), new BasicStroke(1.0f), Color

Does JFreeChart have support for three dimensional charts

喜你入骨 提交于 2020-01-17 07:41:09
问题 As Every one knows JFreeChart supports 2-D (X,Y) charts, but I have a program that needs 3-D (X,Y,Z), 4-D (X,Y,Z,E) … up to six dimensions. For example, my input data looks like this for 2D (X,Y): (0.611787,2.304051) (1.636265 ,2.261579) (1.073176 ,1.188980) If I have 3D (X,Y,Z), it looks like this: (0.142197 ,1.440918 ,0.217366) (0.149352 ,0.748124 ,3.214357) (0.536232 ,0.107004 ,4.198831) If I have four columns, it means 4-D, and may increase to 6-D. I need some help and suggestions if

Real time on x-axis with adjustable scale on x-axis?

大憨熊 提交于 2020-01-17 05:34:27
问题 I want to implement a trend graph with real time data coming continuously,for which am having time on x-axis with format "HH:MM:SS". Now my requirement is to have adjustable scale like 10min or 15min etc....And also how could i limit the time values on x-axis ? Please help me. Thanks! import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.data.general.SeriesException; import org.jfree.data.time.Second; import org.jfree.data

How to convert a string into TimeSeriesDataItem

﹥>﹥吖頭↗ 提交于 2020-01-16 18:51:27
问题 I am using Jfreechart. I have the following code: TimeSeries t1 = new TimeSeries("EUR/GBP"); t1.add(new TimeSeriesDataItem....); But my SQL query gives date in String format & value in Double . I want to use TimeSeriesDataItem . Please let me know how to convert my String into TimeSeriesDataItem . Please let me know how to add my Double value to TimeSeriesDataItem . Thanks in Advance. 回答1: 1) convert your date from String to java.util.Date 2) wrap this Date instance using one of the classes

Rendering a single point in a JFreeChart based on the current Value of a Slider

血红的双手。 提交于 2020-01-16 18:51:10
问题 I'm not yet as much into Java as I'd like to be, so I find my current task to be quite a bit challenging: A chart showing data gathered in another class. A slider whose end value is determined by the last entry of in the dataset used in the chart. The playbutton currently doesn't do anything except letting the slider tick in steps of 5 until it is paused again. My problem right now is: I am supposed to highlight one item at a time in the chart based on which value the slider currently shows.

Rendering a single point in a JFreeChart based on the current Value of a Slider

a 夏天 提交于 2020-01-16 18:50:53
问题 I'm not yet as much into Java as I'd like to be, so I find my current task to be quite a bit challenging: A chart showing data gathered in another class. A slider whose end value is determined by the last entry of in the dataset used in the chart. The playbutton currently doesn't do anything except letting the slider tick in steps of 5 until it is paused again. My problem right now is: I am supposed to highlight one item at a time in the chart based on which value the slider currently shows.

JFreeChart: Displaying data on a scatter plot on mouse click

筅森魡賤 提交于 2020-01-16 16:12:35
问题 I would like to display the x,y data for a given point on a scatter plot that I have created using JFreeChart. I have looked online and in the developer's guide as well and am still having trouble doing this. I create the scatter plot using ChartFactory chart = ChartFactory.createScatterPlot( title, xlabel, ylabel, data, plotOrientation.VERTICAL, false, true, false ); I have tried to implement the chartMouseClicked event. public void chartMouseClicked(ChartMouseEvent event) { ChartEntity

JFreeChart: Displaying data on a scatter plot on mouse click

只愿长相守 提交于 2020-01-16 16:12:05
问题 I would like to display the x,y data for a given point on a scatter plot that I have created using JFreeChart. I have looked online and in the developer's guide as well and am still having trouble doing this. I create the scatter plot using ChartFactory chart = ChartFactory.createScatterPlot( title, xlabel, ylabel, data, plotOrientation.VERTICAL, false, true, false ); I have tried to implement the chartMouseClicked event. public void chartMouseClicked(ChartMouseEvent event) { ChartEntity

Unable to custsomize the bar chart bars width

久未见 提交于 2020-01-16 09:03:45
问题 I'm able to generate the bar chart using bar jfreechart library.Coming to bar chart customization unable to reduce the bars (narrow bars instead of normal bars)width like below pic. I am looking output like first graph but I'm getting output like second graph. I tried chart generation with jfreechart factory.And some cutomization to bars like font and colors changing and adding own legend to the chart.But bars widths related code is not working. chart.setBorderVisible(false); chart.getLegend(