Sign in to follow this  
ripoche

How to adjust min and max value to make sure that one division line corresponds to 0 value

Recommended Posts

We use msline.swf to display financial funds performances.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We would like to have global rule to be able to determine in any case Y axis scale (min value, max value, number of division lines) by making sure:

  • Number of division lines is fixed = 5, which is easy,

  • Min and max values correspond mostly to the min and max values of points to be displayed, which is also very easy,

  • But also that one of the division lines does correspond to the 0 value, which is not easy!

This means that requires some specific algorithm to calculate min and max values. Is there anyone who has got an idea of a rule or algorithm to apply to determine best min and max value, depending on number of division lines and make sure that one of this division line is on 0 value. It looks like it is a usual requirement when we display fund performance graphs.

Share this post


Link to post
Share on other sites

Aha! We have a similar problem. I am using, for example, the column2D chart and updating it with an AJAX script that calls a remote procedure to generate the updated XML. The script calculates max and min, and rounds them off so the graph runs from, say, -2000 to +5000 instead of -1200 to +4800, which was generating distracting resizes if the max hovered between 4600 and 4900 on subsequent updates.

 

 

 

Anyway, with a fixed number of Y divisions, sometimes there's one NEAR but not ON the zero plane, which is, I think, Ripoche's problem.

 

 

 

I don't really care how many Y divisional lines there are, so much as I'd like to force them to occur every 1000 units (or every "some number I choose"), so that in my case they will appear at -2000, -1000, 0, 1000, 2000, etc instead of every (5000+2000)/5 = 1400, at -2000, -600, 800, etc.

 

 

 

Does this make sense? Is there a simple fix, other than putting a lot of smarts into my AJAX script?

Share this post


Link to post
Share on other sites

IN fact, it now appears that stackedColumn2d.swf is not honoring the lower bound. I code "

 

 

 

yAxisMinValue="-15000"

 

 

 

in the chart tag of the XML and if the data only go to -11647, I get -12K as the lowest div instead of -15K as I'd expect.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this