Odhran

programmatically set endvalue for trendline where istrendzone is true

Recommended Posts

I'm looking to render a trendzone from a value I know up to the maximum value charted on the y-axis.

 

e.g.

datasource.trendlines.push({
    line: [{
        startvalue: 5,
        endvalue: #The top of the chart#,
        displayvalue: rangeName,
        color: rangeColour,
        showontop: 1,
        istrendzone: 1
    }]
});

 

How can I get the dynamically get the max value of the y-axis?

I know I can set the max y-axis value but I'm looking to retrieve the value FusionCharts automatically sets when you don't specify a max

 

Many Thanks,

Odhran Hardy
 

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi Odhran,

 

It's not possible retrieve the yAxisMaxValue which is already assigned to chart automatically.  :(

 

If you are explicitly assigning the yAxisMaxValue suppose through a database, then you can retrieve this value.

 

Retrieving automatically assigned values is not possible. 

Share this post


Link to post
Share on other sites

Sumedh,

 

Does this mean that it is impossible to render a trendzone to represent the range x>7?

 

The library also seems to be inconsistent in how it deals with trendzones.

 

E.g.

"line": [{
  "endvalue": "0.4",
  "istrendzone": "1",
  "displayvalue": "Target",
  "showontop": "1",
  "color": "FF00FF"
}]

The above code, missing a startvalue, will draw a range from 0 to 0.4
It does this regardless of whether 0 is the lowest value on the chart!

 

"line": [{
  "startvalue": "1",
  "endvalue": "",
  "istrendzone": "1",
  "displayvalue": "Target",
  "showontop": "1",
  "color": "FF00FF"

}]

The above code, with a missing endvalue, draws a single line at 1.

 

Entering a endvalue less than the startvalue has even stranger results!

 

I believe the ability to set startvalue or endvalue to +/- infinity is something FusionCharts needs to support for trendzones to be usefull.

 

Regards,

Odhran.

Share this post


Link to post
Share on other sites
Guest Sumedh

Hello Odhran,

 

To display trendZone properly, you would need to specify startValue and endValue attributes and startValue should be less than the endValue.

 

If you specify only endValue, then chart will display the trendZone from 0 to specified endValue.

 

And if you specify only startValue, then it will draw only single trendLine.

 

For more information, please refer the following link:

http://docs.fusioncharts.com/charts/contents/AttDesc/Trend.html

 

Hope this helps!

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