IntervalMarker and CombinedDomainXYPlot

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
chulerias
Posts: 7
Joined: Mon Aug 28, 2006 3:19 pm

IntervalMarker and CombinedDomainXYPlot

Post by chulerias » Tue Aug 29, 2006 11:43 am

Hi!

I'm trying to create a chart with dynamic data and several plots. I'm using the CombinedDomainXYPlot and the idea is to build sth like DynamicDataDemo3.java... but using markers to reflect dangerous levels in the graph, I mean, for example if a graph reaches one upper limit I want to create a red marker to show this state (a kind of "DANGER", from 13:30 to 13:35 the graph reached dangerous levels).

The problem is that if I want to add a marker dynamically, I don't know how I can change the endValue of the IntervalMarker, to update this marker every time new data is coming... I haven't found a method in IntervalMarker to do so.

Can you help me?
Thanks in advance.

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Tue Aug 29, 2006 1:20 pm

Unfortunately the markers are immutable, so your choices are:

1) make a local copy of the code and add setXXX() methods and fire a PlotChangedEvent

or

2) call plot.clearXXXMarkers() then add a new marker with the new value.

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 Aug 29, 2006 2:04 pm

The markers were originally immutable to avoid having to write a whole listener/change event mechanism to support modifications. But now I think it would make sense to add the change event mechanism and make these markers updatable.
David Gilbert
JFreeChart Project Leader

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

Locked