Very new to jfreechart. Need to make line charts 'dynamically'. I have a YAML input of datapoints, times and names. I have no way of knowing how many lines will be on each graph.
I have this working easily using the 'Line chart' example here http://www.tutorialspoint.com/jfreechar ... _chart.htm
Problem is, there's too much data for any labels to show up on the X axis. I would like to limit this so that I can get at least some to appear. Have looked around and seems the only way to do this is using an 'XY' chart like this one http://www.tutorialspoint.com/jfreechar ... _chart.htm
I'm struggling to see how I could make one with my YAML though, without any hard coding. I don't know how many lines there will be in the chart. Surely the:
Code: Select all
final XYSeries firefox = new XYSeries( "Firefox" );
firefox.add( 1.0 , 1.0 );
firefox.add( 2.0 , 4.0 );
firefox.add( 3.0 , 3.0 );
Code: Select all
for (i in names) :
final XYSeries i = new XYSeries( i );
for x in values
i.add( x['time'] , x['data'] )
Is this possible to do or is the only way to create an XY chart to hard code it?
thanks.