How can I use a Marker on a Domain axis with CategoryDataset

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Fabrice
Posts: 13
Joined: Fri Apr 23, 2004 8:37 am
Location: France

How can I use a Marker on a Domain axis with CategoryDataset

Post by Fabrice » Tue Apr 27, 2004 3:17 pm

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

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 » Tue Apr 27, 2004 3:24 pm

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

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

Fabrice
Posts: 13
Joined: Fri Apr 23, 2004 8:37 am
Location: France

Post by Fabrice » Tue Apr 27, 2004 4:20 pm

On the Domain axis, I have to put week numbers (from 1 to 53)

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.
Ideally, that's what I'd like to have :
Image

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

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 » Tue Apr 27, 2004 4:32 pm

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

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

Fabrice
Posts: 13
Joined: Fri Apr 23, 2004 8:37 am
Location: France

Post by Fabrice » Tue Apr 27, 2004 4:44 pm

Well...
I haven't done the test now, but will the AreaRenderer draw areas correctly on a XYPlot with a DateAxis ?

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 » Wed Apr 28, 2004 10:40 pm

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

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

Fabrice
Posts: 13
Joined: Fri Apr 23, 2004 8:37 am
Location: France

Areas

Post by Fabrice » Fri Apr 30, 2004 1:59 pm

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

Locked