How to position CombinedDomainXYPlot at given X value

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
JGoodwin
Posts: 27
Joined: Thu Sep 06, 2007 3:19 am
Location: Boston USA

How to position CombinedDomainXYPlot at given X value

Post by JGoodwin » Mon Jul 06, 2009 5:07 pm

I have a CombinedDomainXYPlot, whose domain axis is (at my application level)
an integer index from 0 to N. Now my program wants to pan and zoom so that
a given X-axis value, xTarget, is centered, and zoom so that a given range,
say xWidth, is shown. Is there an example of how to do this cleanly?

(The Y-axis should be no problem; it will autoscale to suit the data shown in
whatever domain-axis range gets exposed).

Thanks
Jim G.

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

Re: How to position CombinedDomainXYPlot at given X value

Post by skunk » Mon Jul 06, 2009 5:31 pm

Get a reference to the shared domain axis, then call this method

Code: Select all

public void setRangeAboutValue(double value, double length)

JGoodwin
Posts: 27
Joined: Thu Sep 06, 2007 3:19 am
Location: Boston USA

Re: How to position CombinedDomainXYPlot at given X value

Post by JGoodwin » Mon Jul 06, 2009 6:05 pm

Oh man -- dunno how I failed to find that. Perfect.

Thanks
jim

Locked