Having just purchased the Developer guide (wich is very nicely written and I recommend to everyone that use JFreeChart), I finished the first charting phase of my application in two days. Thanks David!

All that is missing now is a couple of small things that bothers me: I have this beautiful, multicolored, multi-axis, multi-dataset chart working nicely. All axes are custom ranged. But when you zoom "backwards" on a chart (drag the mouse left and up for a bit), it defaults to reseting all my axes to autorange... how can I redraw the chart again as per the inicial settings/ranges when the user does that "backwards zoom"?
The second thing is actually solved. I just want to know if my solution is good or if it will break with the next release!

Thing is when you get the domain value from a crosshair on a timeSeries chart, it returns a positive number (the index on the series) if that (in my case) second has a value. Otherwise, it returns a number that is negative.
I want the crosshair to behave un-locked to the data, but to always return a value (the value immediatly before the crosshair's position in the series). I kind of saw a logic behind the numbering, and what I do is:
Code: Select all
int itemIndex = timeSeries[k].getIndex( new Second(new Date(millis) ) );
if (itemIndex < 0) // if this second does not have a value,
itemIndex = (-itemIndex) - 2; // go to the second before it that does.
try
{
if (itemIndex >= 0)
{
TimeSeriesDataItem item = timeSeries[k].getDataItem( itemIndex );
double y = item.getValue().doubleValue();
// do something with the value
Thanks!
--
Oscar