Hi!
I use a TimeSeriesChart with continous data input. The chart is only a simple line. Now I like to mark some incoming datapoints in the chart with a point or something like that. (I don't like to mark all points, only this ones that matches to my specified criterias)
Any idea how I can get this?
TimeSeriesChart mark datapoint
Re: TimeSeriesChart mark datapoint
Ok, I have an idea! I will draw a second chart with an invisible line and a shader....
But, how
- can I set the visibility of a TimeSeries
- and how can I use different shades (one timeseries with shade and an other one without)?
But, how
- can I set the visibility of a TimeSeries
- and how can I use different shades (one timeseries with shade and an other one without)?
Re: TimeSeriesChart mark datapoint
Try adding another dataset to your chart with a different renderer (XYLineAndShapeRenderer with only shapes enabled for example). To this dataset, just add the datapoint you want to mark.
You could also have a look at the XYAnnotation class if this is suitable for your needs.
hth,
- martin
You could also have a look at the XYAnnotation class if this is suitable for your needs.
hth,
- martin
Re: TimeSeriesChart mark datapoint
Hi!
I get it working!
Now I am using two TimeSeries (one for the chart(1) and one for the "points"(0))
Then using XYLineAndShapeRenderer (renderer):
Maybe this helps somebody else...
I get it working!

Now I am using two TimeSeries (one for the chart(1) and one for the "points"(0))
Then using XYLineAndShapeRenderer (renderer):
Code: Select all
renderer.setSeriesShape(0, new Rectangle2D.Double(-4.0, -4.0, 8.0, 8.0)); // shapes for the "points"
renderer.setSeriesLinesVisible(0, false); // no line for the "points"
renderer.setSeriesShapesVisible(1, false); // no shapes for the chart
Re: TimeSeriesChart mark datapoint
Anybody an idea how to get the values (labels?) of the points into the chart???
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: TimeSeriesChart mark datapoint
Have a look at the method setBaseItemLabelGenerator(XYItemLabelGenerator generator), which is declared in the XYItemRenderer interface.