Menu

#11 Make Optional Numbers Axis Range Zero Normalize

All
open
All (20)
9
2002-01-12
2001-12-06
No

Hi,

You are probably sick of me by now, but I have feature
request.

I am currently using Chart2D to plot one dataset which
will normally vary between 1300 to 1700. The default
algorithm with a precision of 2, easily calculates
that the greatestValue should be 1700. However, the
default leastValue is 0. If I set CustomLeastValue to
1300, it works fine. However, I plan on using this to
generate about 200 or so JPEGs, and not all of them
require a leastValue of 1300. Some of them maybe 1200
and some maybe 1400 depending on the data. So
hardcoding leastValue is not the solution. I could
write my own method to calculate leastValue and then
set it, but that is something which I believe should
be in the charts2d package. I would like a mechanism,
similar to the one used to calculate greatestValue to
also calculate leastValue.

For the time being, I have done this by making the
following code change to the update(boolean) method in
LBChartArea class.

Change if (!getCustomizeLeastValue()) leastValue = 0;
to if (!getCustomizeLeastValue()) leastValue =
leastValue - emptyValue;

I think I understand the reasoning behind your
selected mechanism. Please tell me if I am wrong.

1) If data is both positive and negative, the y-axis
spreads from -someValue to +someValue.
2) If all data is positive, y-axis spreads from 0 to
someValue.
3) If all data is negative, y-axis spreads from -
someValue to 0.

It would help me if you could add another method, say
setChartDataSetsScale(boolean) which if true, will set
the y-axis scale from leastValue to greatestValue as
calculated by the chart precision number.

Let me know what you think.

Cheers,
Vivek

Discussion

  • Jason J Simas

    Jason J Simas - 2001-12-06

    Logged In: YES
    user_id=179964

    I'll get back to on all this stuff next week. I'm right in
    the middle of graduate school application deadlines...

    Jason

     
  • Jason J Simas

    Jason J Simas - 2001-12-17
    • labels: --> All
    • milestone: --> All
    • assigned_to: nobody --> jjsimas
     
  • Jason J Simas

    Jason J Simas - 2001-12-30

    Logged In: YES
    user_id=179964

    I remember when I last implemented the precision code, I
    wrestled with whether to allow the precision to indicate
    the lower label as well as the upper label. In fact, I
    think that line change was involved. I'll have to remember
    why I put it back to zero. I think that it was becuase I
    thought most people want it at zero. I think that for me
    to change this, there will have to be an intuitive method
    name for selecting between the two behaviors. Maybe
    setNormalizeToZero (boolean).

    Jason

    --
    Jason J. Simas
    BS Comp Sci & Philo
    http://chart2d.sourceforge.net/jjsimas

     
  • Jason J Simas

    Jason J Simas - 2001-12-30
    • summary: Y-Axis scaling --> Make Optional Numbers Axis Range Zero Normalize
     
  • Jason J Simas

    Jason J Simas - 2002-01-02

    Logged In: YES
    user_id=179964

    Vivek

    Chart2D is currently looking for individuals to donate small
    amounts of sponsorship for extending its functionality. If
    you would like this feature implemented, would you care to
    sponsor the work with a $50 donation?

    Jason

     
  • Vivek Mittal

    Vivek Mittal - 2002-01-03

    Logged In: YES
    user_id=105935

    Jason,

    I can not, at the moment, afford to sponsor your work. I
    do believe Chart2D is the best open source charting package
    I have come across and I do hope that you will have the
    time and resources to continue to maintain it.

    As for my feature request, it is not really that
    important. I already have a working hack that works fine
    for me. By making the request, I had hoped that the same
    feature might be available to others who might have similar
    needs.

    Cheers,
    Vivek

     
  • Jason J Simas

    Jason J Simas - 2002-01-12
    • priority: 5 --> 9
     

Log in to post a comment.