Automatic shape scaling when zooming?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
tbuhr
Posts: 1
Joined: Tue Nov 06, 2007 6:39 pm

Automatic shape scaling when zooming?

Post by tbuhr » Tue Nov 06, 2007 6:44 pm

Hi out there,

I googled and searched within here a lot, but I did not find anything concerning an automated shape scaling when zooming will be performed.

Thus, I assume, JFreeChart is not capable of doing that, right?

If so, if I would like to implement this, how would I have to do best?

Remark, I use XYLineAndShapeRenderes -> should I scale my figures manually when zooming will be performed?

Or would there be a more elegant solution?

Thanks in advance,

Tobias

Tony Young
Posts: 14
Joined: Fri Nov 02, 2007 8:21 am

Re: Automatic shape scaling when zooming?

Post by Tony Young » Wed Nov 07, 2007 2:20 am

Good topic :twisted: :twisted:

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 » Wed Nov 07, 2007 12:14 pm

It isn't supported directly, but it is a relatively straightforward modification. In the XYLineAndShapeRenderer class, you could scale the shape (just prior to translating it) in the drawSecondaryPass() method. The only trick is how to determine the scaling factor (you'd need to store the "default" bounds of the x and y axis where there is no scaling, and then look at the current bounds to determine the scaling factor).
David Gilbert
JFreeChart Project Leader

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

efmcuiti
Posts: 4
Joined: Wed Nov 29, 2006 9:44 pm
Location: Bogota - Colombia

Modify the domain scale on a XYChart

Post by efmcuiti » Thu Jan 03, 2008 2:34 pm

Hi there,

I'm kinda confused reading previous posts, so I'll put my question here:

I have a XYSeries chart and because of the user requirements, I need to add to a swing application a couple of spinners that modifies both vertical and horizontal scales of the Chart.

The main issue is that I don't know if that's possible with JFreeChart.

I'll really appreciate any help.

Thanks in advance.
efmcuiti

Locked