I'm trying to add a Marker on the Domain axis of a chart created with the createLineChart method (I'm using a CategoryDataset).
I can't assign a marker to the domain axis of the CategoryPlot.
It seems to be possible only on a XY plot.
Do you know a workaround or an other way to do it ?
Is it a feature I have to ask for ?
Thanks
Fabrice
How can I use a Marker on a Domain axis with CategoryDataset
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
It isn't supported, because I could never see a requirement for adding a marker to a CategoryAxis. What is it you are trying to show?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
On the Domain axis, I have to put week numbers (from 1 to 53)
The plot represents a product's life.
I need :
The red plot is the product life the system calculated, the blue one is its real life.
The green lines show the last week we have to manage the product.
If the green line (the marker) can stop at the intersection of the red curve, it would be better... But I don't want to ask too much...
What do you think of this ?
Fabrice
The plot represents a product's life.
I need :
- - an array to show the period where the product have to be managed closely (It's ok for this point, even if the design is strange at the begining and the ending of the array - see a preceding post "Area vs StackedArea strange different behaviour")
- - a vertical bar to show the week when the product won't need to be managed any more, even if it's life is not at the end.
The red plot is the product life the system calculated, the blue one is its real life.
The green lines show the last week we have to manage the product.
If the green line (the marker) can stop at the intersection of the red curve, it would be better... But I don't want to ask too much...
What do you think of this ?
Fabrice
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
I would use an XYPlot with a DateAxis. But if you want to stick with the CategoryPlot class, one thing you could do is create the marker by overlaying another dataset that contains only one value, and creating a custom renderer to draw the value as a vertical line.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
I think the end points are drawn differently by the XYAreaRenderer compared to the AreaRenderer...but that wouldn't be difficult to change.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Areas
In fact, AreaRenderer and XYAreaRenderer draw the end points the same way.
The difference is between the Area and StackedArea versions.
I think the good way for drawing end points is in the StackedAreaRenderer, not in the AreaRenderer and XYAreaRenderer.
Fabrice
The difference is between the Area and StackedArea versions.
I think the good way for drawing end points is in the StackedAreaRenderer, not in the AreaRenderer and XYAreaRenderer.
Fabrice