How to use auto range without invisible series?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
torkus
Posts: 1
Joined: Thu Nov 16, 2006 7:23 pm

How to use auto range without invisible series?

Post by torkus » Thu Nov 16, 2006 7:29 pm

Moin, moin!

I would like to do the following:
I have a TimeSeriesChart with several series. The user is able to set the
setSeriesVisible() flag for each of them. Now I would like, that if the user selects
the 'Auto Range' from the popup menu, only the visible series are taken into account.
Does anyone knows how to do this?

torkus

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 » Fri Nov 17, 2006 10:46 am

That is an enhancement that needs to be made to JFreeChart.
David Gilbert
JFreeChart Project Leader

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

gibsonb
Posts: 1
Joined: Fri Sep 30, 2011 6:14 pm
antibot: No, of course not.

Re: How to use auto range without invisible series?

Post by gibsonb » Fri Sep 30, 2011 6:22 pm

David first I'd like to thank you for creating JFreeChart. I have purchased the developer guide twice over the past few years and have used JFreeChart on multiple projects.

I am currently trying to implement the Auto Range for visible series only feature. I have download the latest source code and I am ready to implement the check for calculating the auto range from only visible values. Do you have any suggestions or ideas on how you planned to implement it? I would be glad to do the code changes and then submit my changes to be included with the next release of JFreeChart.

The project I am working on is the DAQ Data Analyzer. You can view my blog about it at: http://gibsonsystems.com/sblog. Any suggestions or guidance would be greatly appreciated.

Thanks,
Brad Gibson

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: How to use auto range without invisible series?

Post by david.gilbert » Sat Oct 01, 2011 5:46 am

Hello Brad,

In the AbstractRenderer class, there is this method added in version 1.0.13:

public void setDataBoundsIncludesVisibleSeriesOnly(boolean visibleOnly)

Sets the flag that controls whether or not the data bounds reported by this renderer will exclude non-visible series and sends a RendererChangeEvent to all registered listeners.

Parameters:
visibleOnly - include only visible series.
Since:
1.0.13

It should do what you are looking for.
David Gilbert
JFreeChart Project Leader

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

colomb
Posts: 15
Joined: Fri May 29, 2009 8:10 pm

Re: How to use auto range without invisible series?

Post by colomb » Wed May 09, 2012 9:37 pm

David,

It appears XYBarRenderer ignores that flag. It overrides findRageBounds(). Is this an oversight or intentional? Thanks,

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: How to use auto range without invisible series?

Post by david.gilbert » Thu May 10, 2012 4:04 am

It looks like an oversight, but I'll need to do a little bit of testing to be sure. It looks to me as if the XYBarRenderer.findRangeBounds(boolean) method should just call AbstractXYItemRenderer.findRangeBounds(XYDataset dataset, boolean includeInterval).
David Gilbert
JFreeChart Project Leader

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

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: How to use auto range without invisible series?

Post by david.gilbert » Thu May 10, 2012 5:11 am

I made this change which will be included in the eventual 1.0.15 release:

http://jfreechart.svn.sourceforge.net/v ... 52&r2=2468
David Gilbert
JFreeChart Project Leader

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

colomb
Posts: 15
Joined: Fri May 29, 2009 8:10 pm

Re: How to use auto range without invisible series?

Post by colomb » Thu May 10, 2012 3:01 pm

Wow, that was quick. Thank you.

Locked