A discussion forum for JFreeChart (a 2D chart library for the Java platform).
-
fhaselbein
- Posts: 6
- Joined: Tue Oct 16, 2007 3:42 pm
Post
by fhaselbein » Tue Oct 16, 2007 3:55 pm
Hi,
I'm using XYLineAndShapeRenderer for my line chart and on my RangeAxis, I'm plotting an IntervalMarker to let the user see a threshold:
Code: Select all
XYPlot plot=...;
IntervalMarker thresholdBox = new IntervalMarker(min,max);
plot.addRangeMarker(dataSetIndex, thresholdBox, thresholdLayer);
I'm adding multiple datasets to my plot. The user has the possibility to make one of the datasets the "active" one, in this case, the thresholds of the dataset need to be displayed. Else, they shouldn't be displayed, whereas the dataset's line itself still remains. So, my question is: Is there some possibility where I can set various thresholds belonging to a dataset to (in-)visible?
thanks a lot
bye Michael
-
dtopolsek
- Posts: 8
- Joined: Wed Oct 10, 2007 10:46 am
-
Contact:
Post
by dtopolsek » Wed Oct 17, 2007 6:38 am
well I assume you can set Color property of interval you don't want to see the same color as background of your chart/plot, that way it will become invisible.
-
fhaselbein
- Posts: 6
- Joined: Tue Oct 16, 2007 3:42 pm
Post
by fhaselbein » Wed Oct 17, 2007 9:41 am
Hi,
thanks, but it sounds to me more like a hack than a solution. Also, this works when I want to have the threshold in the background, when I have it in the foreground, the IntervalMarker will dim the graph itself, as it is still here and not invisible...
Thanks for your help
Michael
-
fhaselbein
- Posts: 6
- Joined: Tue Oct 16, 2007 3:42 pm
Post
by fhaselbein » Wed Oct 17, 2007 11:28 am
I'd like to answer myself, as I found a solution:
I could set the Alpha to 0.0f, which makes the threshold transparent. If I want to make it visible again, I can set it to the old alpha value (seems to be something about 0.5f).
I'm still not enthusiastic about this solution, so if you have better ideas, please don't hesitate to help, but I think this is quite good so far
Bye Michael
-
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 Oct 17, 2007 1:19 pm
The best solution is probably to add a 'visible' flag to the Marker base class, then check this before drawing the markers. The drawing code is scattered around a few places (CategoryPlot, XYPlot and AbstractXYItemRenderer, at a minimum), but the change is otherwise pretty simple. If you do this, feel free to submit a patch - otherwise, I'll add it to my list and do it eventually.
-
fhaselbein
- Posts: 6
- Joined: Tue Oct 16, 2007 3:42 pm
Post
by fhaselbein » Fri Oct 19, 2007 9:25 am
Hi,
thanks a lot for your answer. I'd like to add this (and some other features) to JFreeChart, but I've checked out the version 1.0.6 from sourceforge's CVS and it is not compilable (some methods are referred but they're not existing). The HEAD of this CVS is compilable but it is incompatible with our actual program implementation.
As this is a "private" discussion and PM is disabled (at least the forum tells me so), I'd propose - if you want - to discuss this per mail: fhaselbein (at) gmx.at
Thanks a lot
bye Michael