Non - numeric values for Series Line chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
pankaj_patil20
Posts: 6
Joined: Thu Sep 21, 2006 6:16 pm

Non - numeric values for Series Line chart

Post by pankaj_patil20 » Thu Sep 21, 2006 6:19 pm

Hi Friends

I am new to the JFreeChart environment.

I am trying to plot a Line chart having 3 series.
If I use numeric values for X axis values, I am good.
eg
XYSeries series1 = new XYSeries("Actual");
series1.add(4.0, 5.0);


The problem arises when I want to use String values for X co-ordinates.

Can anyone help me out on this ?

Thanks in advance :D

Regards

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri Sep 22, 2006 10:18 am

You have two options:

(1) Use the CategoryPlot class - this is designed for non-numeric x-values;

(2) Keep using XYPlot, but replace the x-axis with a SymbolAxis, and code your dataset accordingly (x values as integer index values).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

kash22
Posts: 5
Joined: Thu May 04, 2006 10:30 am

Post by kash22 » Tue Oct 10, 2006 10:14 am

Hi david,
I recently faced the same problem what pankaj faced.
I have a scatterplot and i want non-numeric values for the x-axis.
I cant use category plot as i have to use XYLineAndShapeRenderer.
Whereas using SymbolAxis makes most of my values disappear.
How to use SymbolAxis for XYPlot correctly?
Thanks in advance.
kash

pankaj_patil20
Posts: 6
Joined: Thu Sep 21, 2006 6:16 pm

thanks

Post by pankaj_patil20 » Mon Oct 16, 2006 3:53 pm

thanks !
david.gilbert wrote:You have two options:

(1) Use the CategoryPlot class - this is designed for non-numeric x-values;

(2) Keep using XYPlot, but replace the x-axis with a SymbolAxis, and code your dataset accordingly (x values as integer index values).

Locked