DataSet « Dataset « JFreeChart Q&A





1. modify dataset of an already built chart with Java and JFreeChart    stackoverflow.com

Let's say I've generated a chart with the following code:

private ChartPanel createChart(){
        XYSeries series1 = new XYSeries("First");
        ...

2. retrieve data set having only a ChartPanel reference (Java + JFreeChart)    stackoverflow.com

This question in partially related to my previous post on this subject. I would like to know after a ChartPanel has been constructed :

public ChartPanel buildChart(){
    XYSeriesCollection dataset ...

3. adding dataSet    jfree.org

Hi I have an XYPLot and i want to add a series of data set containing each one two points. My question is how to create a XYDataset with two points. Code: Select all dataset2[index] = new ImpliedVolatilityDataSet(vect); ............... JFreeChart chart = ChartFactory.createBubbleChart( "Implied Volatility", ...

4. flicker on dataset change    jfree.org

I'm updating the chart dataset dynamically and notice a flicker on dataset change only if the ChartPanel has a transparent background and the JFreeChart has a transparent background paint (I want the background color of the JPanel that I have placed the ChartPanel on top of to show through). Is there a way to stop the flicker? Thanks! BTW, I am ...

5. java.lang.OuofMemoryError-when adding values to a dataset.    jfree.org

Hi, I am trying to develop a Swing GUI Application which would read a file every second and plot a point in the TimeSeriesGraph. So I have a thread going on every sec which would read the file and add a point to the Dataset of the TimeSeries Chart. This goes on for 40 mins to an hour , it varies ...

6. How to use Dataset Group    jfree.org

7. Different types of charts for same DataSet    jfree.org

Hi, I have created a TimeSeriesCollection. The data stored in the different series represent the value of a given parameter at a given point in time. I am able to generate different types of graphs: line area shapesAndLines bar I need to also present: stacked bars pies and all of these graphs as 3D graphs. I read in this forum and ...

8. Value marker from dataset    jfree.org





10. Tracking data indexes in Datasets    jfree.org

I'm using JFreeChart to build drillable web reports (i.e. - click on a slice of a pie chart, it displays data relating to that slice). Using PieChart3DDemo1.java as a reference, say I had a database table with rows for Visual Basic, Java, C/C++, PHP, Perl. In the PieDataset this becomes a key/value relationship: Visual Basic = 10, Java = 43.2, etc. ...

11. OHLC dataset    jfree.org

12. combinedDomain DataSet to range chart    jfree.org

i have dataset with x axis as date and y axis as price. and i use that in combinedDomainXYPlot. works fine. but now i need to use same dataset in Range axis with price as my x-axis(domain axis) and date as my y axis (range axis) with some other chart. is there any way i can switch x and y values ...

13. Using multipal dataset in single chart    jfree.org

HI, I am trying to generate barchart having 2 Y-Axis. For that i have to use two different dataset. I am using following code. But the graph shows only values from dataset1. What else should I add in following code? final NumberAxis rangeAxis0 = (NumberAxis) plot.getRangeAxis(); rangeAxis0.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); final NumberAxis rangeAxis1 = (NumberAxis) plot.getRangeAxis(); rangeAxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); plot.setRangeAxis(0, rangeAxis0); plot.setRangeAxis(1, rangeAxis1); plot.setDataset(0, dataset1); plot.setDataset(1, ...

15. How to create a dataset for an OHLCDataset?    jfree.org

OHLCDataset dataset=createDataset(stockId); ----------- -- - private OHLCDataset createDataset(String stockId) { int length_pair=pair.length;// Date[] date=new Date[length_pair+1]; double[] closePrice=new double[length_pair+1]; double[] openPrice=new double[length_pair+1]; double[] highPrice=new double[length_pair+1]; double[] lowPrice=new double[length_pair+1]; double[] volume=new double[length_pair+1]; OHLCDataItem[] dataItem = new OHLCDataItem[length_pair+1]; for(int i=0;i

16. spider chart and dataset values    jfree.org





17. Problem adding new datatitem to OHLC Dataset    jfree.org

Problem adding new datatitem to OHLC Dataset by q2klepto Tue Apr 11, 2006 6:16 pm Hello I'd like to add to a dataset after ive created it, and have this data item update constantly as well as render in a different color..but right now i cant seem to add the dataset item after ive originally created it..heres the code i ...

19. Removing datasets but autorange doesn't get it ?    jfree.org

Hi All I have the following problem: I have a XYcombined chart with 4 subplots in it and 4 XYSeries in each subplot. I have a set of checkboxes were the user can add/remove any XYserie from a subplot. For this I use renderer.setSeriesVisible. However my problem is that when a serie is "not visible" the autorange still works as if ...

20. Edit Dataset on keypress    jfree.org

Hi, I am new to JFreeChart and was wondering if it is possible to actually edit or update an existing data point. I have an XYDataset with two data series in it and I am trying to move one series of data around (without re-scaling the axis) by using the arrow keys. I think, to do this I need to create ...

21. How to insert one double variable in dataset?    jfree.org

How to insert one double variable in dataset? by FEPS Fri May 26, 2006 6:35 pm Code: Select all PreparedStatement QfaseA = connection.prepareStatement("SELECT valor FROM cemig WHERE carga = ? AND data = ?"); PreparedStatement QfaseB = connection.prepareStatement("SELECT valor FROM cemig WHERE carga = ? AND data = ?"); ...

22. Please help a newbie!!! Reading in a dataset from a file    jfree.org

Please help a newbie!!! Reading in a dataset from a file by gmsc Fri Jul 07, 2006 4:55 pm Hi all, I hope you can help. I am trying to create an OHLC chart from a dataset which is stored in a file. I am using the following code, adapted from the demo source code. The code complies, but when ...

23. XYStepRenderer only works for first dataset?    jfree.org

by forsey85 Tue Jul 18, 2006 9:36 am My source code isnt easy to post as it isn't very self contained, but I made a demo instead: Code: Select all import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.WindowConstants; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.XYStepRenderer; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; public class StepChartExample extends JFrame { ...

24. Annotations relative to dataset items    jfree.org

I am using a TimeSeriesChart with annotations that correspond to items from my dataset(XYItemEntity displayed on the chartPanel). The plot is an XYPlot and I am retrieving the list of annotations using: plot.getAnnotations() , from there I am able to get the X and Y coord. of an annotation. I am unable to take these coordinates from the annotation and use ...

25. Reducing huge dataset    jfree.org

Hello, I'm having a problem. I have a sensor that reports 2 times every second. That's almost 173000 times a day. I want to show the readings on a chart. The problem is, how can I reduce the dataset size to make it more manageable? If I feed JFreeChart with a TimeSeries of 173000 values, I have to go out for ...

26. Different value axes, same dataset    jfree.org

Hi, I'm plotting a time series graph. I would like it to have two range axes, one either side. All the examples for dual axes that I've seen assign individual series to one axis or the other. However, in my case, I want all of my series to be mapped against both axes. The second axes is merely a constant scaling ...

27. Reset bins = new dataset?    jfree.org

Hi I want to let my users adjust the number of bins for a HistogramDataSet at runtime. I don't see a method which permits this so I just create a new HistogramDataSet based on the user's bin request . The problem is that I can't seem to swap a chart's dataset at runtime (I've looked for methods such as chart.setDataSet, etc). ...

28. Does Dataset will sum the same item value added to it?    jfree.org

Hi, summing up your data is not the responsibility of the DataSet. The database will do this. your results perfectly match your SQL statement. The sum-function of SQL sums all items in a group. The group's contents are defined by the "GROUP BY" clause, in your case it is item, s_type and color. As the color of both books is different, ...

29. setRange based on visible dataset ??    jfree.org

i am ploting closing prices for like 1 year. so my dataset has 1 year of values. say i have highest value 80.0 and lowest value is 60.0. this will be my range for 1 year data. but now i have option where user can select 6 months as domain axis limit (view only 6 months of data). i set the ...

30. Can I display the specific column keys for the dataset    jfree.org

Can I display the specific column keys for the dataset by vivian22 Wed Nov 29, 2006 10:56 pm I created a bar chart. JFreeChart chart = ChartFactory.createBarChart ( "", // chart title "Test", // domain axis label "", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend true, // tooltips? false // URLs? ); Then ...

31. Is is posibble adding 2 dataset? (or some other operations)    jfree.org

Hi all, I need to add 2 datasets. DS1 : DATE | S1 1-1-2006 | 48 1-2-2006 | 32 1-3-2006 | 3 1-4-2006 | 45 1-5-2006 | 47 DS2: DATE | S2 1-1-2006 | 45 1-2-2006 | 64 1-3-2006 | 67 1-4-2006 | 13 1-5-2006 | 54 DS1 + DS2 = TDS TDS: DATE | S1 | S2 1-1-2006 | 48 ...

32. Changing stroke shape for different datasets    jfree.org

Hi. I've tried different ways to do this, but it just doesn't seem to be working for me. Here is what I've done: Code: Select all chart.getXYPlot().getRenderer().setStroke(new BasicStroke(0.0f, BasicStroke.CAP_ROUND, ...

34. setSeriesShape() of cloned XYRenderer for 2nd dataset    jfree.org

setSeriesShape() of cloned XYRenderer for 2nd dataset by paradoxoff Sat Feb 17, 2007 2:42 pm Hi there, First of all, I would like to say "thank you" for making such a great thing like JFreeChart available. I have spent some time to look for a charting program that would allow the creation of nice looking, feature-rich charts w/o learning a ...

35. Autoscaling datasets    jfree.org

36. Assignment from one dataset to another    jfree.org

David, I was doing some servlets with the new swingworker classes and I extended your DefaultCategoryDataset so I could do threaded calls and allow my applets to update in the background. If you want to add it to the next release here is the code (copied from your equals method) : public boolean assign (Object obj) { if (obj == this) ...

38. how to use dataset from database in jfreecharts    jfree.org

JFreeChart doesn't provide much direct support for JDBC-based datasets. There are some basic classes in the org.jfree.data.jdbc.* package, but generally I think it makes sense to write your own code to read the data (so you can match the code to the structure of your data in the database). Of course, if anyone knows a good general purpose way to create ...

39. constructing the dataset in XYDataset at once and performanc    jfree.org

constructing the dataset in XYDataset at once and performanc by Narayan Thu Apr 12, 2007 3:17 pm Hello, I want to draw a line chart having the count in the y axis ( range axis ) and the dates in the x axis ( domain axis ) to represent a huge set of data ie hourly data of 60 days. ...

40. remove a dataset    jfree.org

42. How to change dataset values???    jfree.org

43. How do I delay repainting until Dataset has all data?    jfree.org

Hello, I am trying to write a framework into a piece of software that means it easier for other developers in the future to create new code that implements different JFreeChart functions while learning as little about JFreeChart as necessary. The developer obviously needs to understand how to create and populate a dataset and how to declare a new JFreeCart instance, ...

44. Dynamic addition of data to dataset    jfree.org

Hi, I have a simple bar chart, which is displaying 5 bars and their associated values. Is there any way to add a new bar and a new value dynamically to the barchart? I cannot change my original dataset sql statement and need to add the new bar/value in code. thx in adavance. Reza

45. JFreeChart with Huge Datasets - Optimization    jfree.org

Hi We have to deal with huge datasets in our application (usually over 2 million points). We have developed a custom XYPlot that optimizes the rendering by testing that points that translate to same pixels are drawn only once. I was thinking that could XYPlot be further optimized by first "drawing" the pixels to an two-dimensional double array where the dimensions ...

46. Removing dataset names from under a chart    jfree.org

Hi, I'm making an XY chart with multiple datasets, by grouping some XYSeries into an XYSeriesCollection and then plotting them. Now, by default, when I do this, the names of the datasets are printed in a box below the chart (is this called the legend???). I was wondering if there is a way to get rid of the the plot labels ...

47. Need handling of null values by Interval datasets    jfree.org

Hello My reading of the JFreechart code and documentation indicates that currently (1.0.6) it cannot handle null values for Interval datasets since the methods refer to double primitive types rather than the Double and Number classes available for non-interval datasets. Has anyone extended or modified JFreechart to provide this capability? If not, maybe Dave could suggest the best approach to this ...

49. XY Dataset with (Integer, String)    jfree.org

Is it possible to do a simple graph with the - X axis is Integers - Y axis is Strings Such that the datapoints would be something like (1,"Fred") (2, "Jane") (3, "Fred") (4, "Pete") Which dataset would I use for this? Thank you. Which charts accept that dataset? Thank you again.

50. XYBarDataset: no getter or setter for underlying dataset?    jfree.org

I am running 1.0.3 version of JFreeChart and have extended the XYBarRenderer. I need to have access to the underlying dataset within the XYBarRenderer, is this possible? Currently there is only the XYBarDataset instance within the Renderer. I need access to the underlying dataset because I have extended the underlying dataset to be a specialized dataset of my own. Come time ...

51. Dataset converter    jfree.org

52. inheritance hierarchy for dataset classes    jfree.org

I just got hit by the following exception: java.lang.ClassCastException: org.jfree.data.time.TimeSeriesCollection cannot be cast to org.jfree.data.xy.TableXYDataset Is there a reason org.jfree.data.time.TimeSeriesCollection is not derived from org.jfree.data.xy.TableXYDataset? I would have expected the time series collection to be derived from the basic XY dataset classes since it is just a special case of an XY dataset. If I change my timer series collection into ...

53. Changing the dataset on runtime?    jfree.org

Is it possible to give a new dataset to a JFreeChart chart once i have created it ? As in : Initial creation : Code: Select all DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(1.0, "Row 1", "Column 1"); dataset.addValue(5.0, "Row 1", "Column 2"); ...

54. Dataset limtation?    jfree.org

Hi, I'm working with jFreeChart for only two days now and facing a problem, to which I didn't find a solution in the forums - so I'm posting it. The solution sure is simple... I created a BarChart using ChartFactory and getting Data from a DefaultCategoryDataset. Everything works fine, but when I put more than 12 values into the Dataset only ...

55. Improving performance for huge datasets - (autosort)    jfree.org

Hi all, I create a huge dataset with 1 million Points (a scatter plot, but this is not so important). It used to take me 20 seconds on Mac Book Dual Core 2 - 3G ram. I've noticed that trying to add all my points one by one to XYSeries was the bottleneck. I've switched off the notify, but still no ...

56. Exporting data within a DataSet    jfree.org

Hi, I'm fairly new to JFreeChart. I am doing a query into my database to build a DataSet then creating a chart, it works great. In addition to displaying a chart I'd also like to make the data for the chart available for download via CSV, Excel or some other common format. Is there any way to do this in JFreeChart ...

57. Casting and accessing dataset problem    jfree.org

Casting and accessing dataset problem by jfaio Tue Jun 24, 2008 10:14 am Hi there .. my problem is following : i extended ChartPanel to overwrite sume methods like Code: Select all protected String getTooltipAtPoint(Point point) { String result = null; ...

58. join dynamic and static dataset    jfree.org

59. Graphic returns an empty or empty Dataset    jfree.org

Graphic returns an empty or empty Dataset by exodia Wed Aug 20, 2008 10:20 pm help build a chart bar Graphic returns an empty or empty Dataset No data shows in bars Chart Help Me Code: Select all import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import org.jfree.chart.*; import org.jfree.chart.plot.*; import java.sql.*; import org.jfree.data.jdbc.*; ...

60. How to Display Dataset - Customized    jfree.org

I customized the drawing of line chart as per my requirement and I was able to get output. When I add a new dataset to my collection, the line drawn overlaps with the previous graph. I need the graph to be display one below the other ( even when they have same plots). i(.e) if in dataset 1 I have ((0,100) ...

61. Connecting Two dataset Series-Overlapping Problem    jfree.org

Connecting Two dataset Series-Overlapping Problem by Umadas Wed Sep 10, 2008 10:13 am Hi I have a requirement in which i have to draw a series(Say Series) in from suppose 1 to 10 in x axis using XYDataset.Now another series(say Predicted) is drawn which contains only one data at the 11 the position in X Axis.Now i want to join ...

62. Two datasets, one stacked, both side by side... Crash!    jfree.org

Two datasets, one stacked, both side by side... Crash! by Shurikane Tue Oct 07, 2008 2:26 pm Hello to the folks at JFreeChart. I am programming using the libraries jcommon v.1.0.10 and jfreechart v.1.0.6. I wish to create a chart with two datasets, one of which is to be stacked. The first dataset needs to be apart or offset from ...

64. Chart with 2 Dataset !!    jfree.org

65. How do I add data to the dataset    jfree.org

How do I add data to the dataset by colmsmith Thu Dec 18, 2008 12:15 am Thanks for reading this. I am a newbie that needs to be able to add custom data to the dataset. I have created string variables and can set them, but it appears that the chart gets created before the values are changed. Here's my ...

66. Getting the data from the dataset    jfree.org

I have this code stanza to parse the data from an xml file. ... ins = new FileInputStream(new File(fileName)); parser.parse(ins, handler); CategoryDataset bwDataset = handler.getDataset(); ... Two questions: 1) I don't want to parse the file again, can I some how loop through the CategoryDataset and get the data? (code example pls.) 2) Or better yet, can I output the CategoryDataset ...

67. JFreeChart Performance on large dataset    jfree.org

Hi, I have a problem when I use ~100,000 data points on a TimeSeriesChart with MilliSecond. On a graph refresh it uses heaps of memory and CPU. See attached screenshot. The peak is when it is refreshing the graph. The high level is when the full data set is displayed. The low bit is when a small subset of data being ...

68. Merge Two Dataset into one    jfree.org

69. Need extra information in dataset    jfree.org

Hi, I'm trying to create a scatter plot, but I noticed that the dataset only lets me specify x,y values along with a label for the entire series. However, I'd like to also include additional information in a mouseover. I understand how to manipulate the tooltips, but I'm not sure how to add something other than what is currently in the ...

70. XYPointerAnnotation not primary dataset    jfree.org

Hi i have a problem to add an annotation relative to a dataset that isn't the primary. Imagine a xy plot where I plot, for example, two datasets with the same x axis and two different y axis. Then I want to draw an annotation for the two different dataset. When I click with the mouse on the plot of the ...

71. adding array of values to dataset    jfree.org

hii, i am new to jfree chart is it possible to add array of (x , y ) values XYseries of the dataset this is the work done by mee., but i am getting more bugs Code: Select all dataitems[] xypiont = new dataitems[10]; xypiont[0] = new dataitems(451, 3500); ...

72. how to have same values in a dataset    jfree.org

while(it.hasNext()) { Vertice v = (Vertice)it.next(); dataset.setValue(v.getPeso(),"Affidabilit",v.getCarattere()); ...

73. How to createXYLineChart for a dataset with non-unique value    jfree.org

I have a 'dataset' with non-unique values; assume a circle points with angle range = 0: 1: +360. What I'm using right now is: Code: Select all JFreeChart chart = ChartFactory.createXYLineChart( title, // chart title ...

76. What Dataset to choose?    jfree.org

Hello all, I'm new to JFreeChart and I need some help. I have a project for university to do which must be very flexible. So i am searching for a DataSet which has the following abilities. I hope someone can help me. - Output possible on LineChart, BarChart and PieChart (maybe some exceptions can be made if needed) - 2D data ...

77. how to pass the values to dataset in a StackedBarChartDemo4?    jfree.org

how to pass the values to dataset in a StackedBarChartDemo4? by ankita.dev Wed Aug 26, 2009 7:14 am Hello Everyone, I needed to develop an application using JFreeChart so, I found the StackedbarChartDemo4 example code and it ran beautifully after passing the result in following manner: Code: Select all private CategoryDataset createDataset() { ...

79. Which dataset to use    jfree.org

Re: Which dataset to use by raj_jfree Tue Oct 20, 2009 10:49 am Hi, I have used DefaultXYZDataset and XYBubbleRender these is the class i have written. I have values double ad[] = { 50,100,150,200 }; // i don't have this array just for testing i have used it double ad1[] = { 10, 20, 30, 40 }; // y ...

80. Chart Animation - Dataset    jfree.org

82. A problem about dataset!    jfree.org

A problem about dataset! by zhou851213 Tue Dec 22, 2009 7:09 am Default, each column generates 21 bars,although some bars can not be displayed,I want every column display its own bar , for example column "c1" display "s1","s2","s3" only. No default other bars.My English is not good,I hope you can understand what I mean Thanks for your answer Here is ...

83. Dataset Problem?    jfree.org

84. Dataset not showing    jfree.org

Currently I am trying to create a dynamic candle stick chart that I can add an remove dynamic line charts as overlays. The problem I am is that i can not get the dataset that belongs to the line chart to ever show up. I have been able to narrow the problem down to the fact that the dataset will show ...

85. Dataset with record DATE problem    jfree.org

87. dataset title ?    jfree.org

Hello ! I've created a plot with multiple datasets (so each dataset has one serie) in such way (there a lite version!) Code: Select all for(int i=0; i

88. Mapping pixels back to dataset values to generate crosshairs    jfree.org

Mapping pixels back to dataset values to generate crosshairs by davesnowdon Mon Oct 25, 2010 6:49 pm I'm working on a web application in which a servlet generates an image of a chart which is embedded in a web page. I'd like to implement dynamic crosshairs using javascript so that as a user moves the mouse over the chart, the ...

89. Range to max of datasets    jfree.org

Hi all, I have a chart with three time series datasets, and I need to set the range to the max value of the datasets. For example one set has data with max range of 100, the other 150, and the third 300. So I need the range axis to go from zero, to 300. How do I do that? The ...

90. BoxandWhiskersplot Dataset    jfree.org

BoxandWhiskersplot Dataset by bladepit Fri May 27, 2011 11:57 am Hello everybody, i have an problem during adding 4 values to my dataset of my boxandwhiskersplot. Here is my code: Code: Select all DefaultBoxAndWhiskerCategoryDataset d = new DefaultBoxAndWhiskerCategoryDataset(); 381 List f = ...