Hello
I am using JFreeChart. In the Line charts
1) If I have two categories with the same values, only one category data can be seen (the line will be overwritten), say I have two categories XX and YY. If the category XX values are drawn first and the YY category data is drawn later, I see only one category data (unless and until I know the other category also has same data). Can I over come this???
2) In the line charts for the values, there will be a small dot, a small rectangle or a triangle etc for different categories, what should I do to remove this (I do not want this to be drawn).
3) Also I have one line which is a consolidated data for all the categories in the data passed, can I represent this line in different way (dotted etc), now I am using different color for different categories and all lines are solid lines, I want only one line to be dotted line and the other category lines to be solid lines.
I request you to guide me in this.
Regards
Girish
Using Line Charts
Re: Using Line Charts
Girish wrote:
> 1) If I have two categories with the same values, only one
> category data can be seen (the line will be overwritten), say
> I have two categories XX and YY. If the category XX values
> are drawn first and the YY category data is drawn later, I
> see only one category data (unless and until I know the other
> category also has same data). Can I over come this???
Categories must have different values, otherwise JFreeChart can't distinguish between them.
> 2) In the line charts for the values, there will be a small
> dot, a small rectangle or a triangle etc for different
> categories, what should I do to remove this (I do not want
> this to be drawn).
The settings are in the LineAndShapeRenderer class. Unfortunately, in 0.9.4 there are no methods for changing the settings, so you need to create a new renderer and add that to your plot. In 0.9.5, you will be able to modify the existing renderer.
> 3) Also I have one line which is a consolidated data for
> all the categories in the data passed, can I represent this
> line in different way (dotted etc), now I am using different
> color for different categories and all lines are solid lines,
> I want only one line to be dotted line and the other category
> lines to be solid lines.
Use the setSeriesStroke(...) methods in the Plot class.
Regards,
DG
> 1) If I have two categories with the same values, only one
> category data can be seen (the line will be overwritten), say
> I have two categories XX and YY. If the category XX values
> are drawn first and the YY category data is drawn later, I
> see only one category data (unless and until I know the other
> category also has same data). Can I over come this???
Categories must have different values, otherwise JFreeChart can't distinguish between them.
> 2) In the line charts for the values, there will be a small
> dot, a small rectangle or a triangle etc for different
> categories, what should I do to remove this (I do not want
> this to be drawn).
The settings are in the LineAndShapeRenderer class. Unfortunately, in 0.9.4 there are no methods for changing the settings, so you need to create a new renderer and add that to your plot. In 0.9.5, you will be able to modify the existing renderer.
> 3) Also I have one line which is a consolidated data for
> all the categories in the data passed, can I represent this
> line in different way (dotted etc), now I am using different
> color for different categories and all lines are solid lines,
> I want only one line to be dotted line and the other category
> lines to be solid lines.
Use the setSeriesStroke(...) methods in the Plot class.
Regards,
DG