tpull

y axis max/min

Recommended Posts

Hi, I am trying to create a line chart and need to set y axis max and min values explicitly.  I have three data series in the chart.  A numerator, a denominator, and a metric which is equal to (numerator/denominator)*100.

My numerator values are very high (~1000000) and denominator value is very high too (~850000) with the metric value always being less than 100 (In this example it would equal 85).

Because the numerator and denominatorvalues are very high, the scale on the y axis is way out of whack.  I don't need to see the lines for numerator and denominator, only have their values in the hover over when hovering over the points on the metric line.  Therefore if I could force the scale on the y axis to something like this it would be perfect:

chart.yaxisminValue = -50
chart.yaxismaxValue = 150

I can set these chart attributes in the JavaScript and it works fine with only the metric value in the chart.  However, when I add my numerator and denominator data it overrides the manual setting of the y axis max/mins and goes out of whack again. 

 

Is there a way to not allow the automatic override of the yaxis max/mins?  Again, the lines for this data falling out of visibility is not an issue.

 

Thanks!

TP

 

Share this post


Link to post
Share on other sites

Hi,

 

Please find the below points with respect to the y-axis limits and dataset values :

- The dataset(line series) is plotted against the y-axis. It would accommodate all the provided values within the y-axis range. (For example -if the dataset have values ranging from 0 to 10000, the y-axis would accommodate them in the scale 0 to 10000)

- The y-axis limits could be explicitly set using "yAxisMinValue" and "yAxisMaxValue" attributes, but if the values provided in the dataset exceeds the explicitly set limit, the y-axis limits would be modified accordingly to accommodate all the values. (For example - explicitly range set as 0 and 10000, but a value is present in dataset like 10008, then the y-axis scale would be modified)

- It is not possible to restrict to plot a value if it exceeds the explicitly set minimum or maximum range of y-axis.

 

So, for your case, when you are plotting numerator and denominator against the y-axis with value ranging on higher side like 1000000, along with the other metric dataset series with values ranging to 100. The single y-axis would accommodate all the values on its scale of 0 to 1000000. Hence, the metric dataset line would appear at the bottom as per the y-axis scale.

 

Alternatively, we would suggest you to use the dual y-axis chart types to overcome this situation. Chart type - mscombidy2d

You can plot the "metric" dataset on the secondary y-axis on the right separately, so that it can render on the right axis with a scale of 0 to 100. Please find the below sample for reference :

http://jsfiddle.net/ezqaft37/1/

Documentation link : https://www.fusioncharts.com/dev/chart-guide/standard-charts/combination-charts#2d-dual-y-axis-combination-chart

Attribute list : https://www.fusioncharts.com/dev/chart-attributes/mscombidy2d

 

Thanks,

Akash.

Share this post


Link to post
Share on other sites

Hi Akash,

 

Thanks for the response.

Is there a way to have the numerator and denominator value in the hover over box without those data sets being charted on the graph?  That would meet my need.

 

Thanks!

TP

Share this post


Link to post
Share on other sites

Hi,

 

If you do not want to plot the line or series for numerator and denominator on the chart, but want only the values to show in tooltip on hovering the line plots(of Metric series).

Then you can define the "toolText" attributes within individual data objects of a simple line chart, with the numerator and denominator values so that they are shown in the tooltip. Please refer to the below samples for reference :

Sample with numerator and denominator(static) in toolText attribute : http://jsfiddle.net/yrt9zqpv/2/

Sample with numerator and denominator(from variable array) in toolText attribute : http://jsfiddle.net/yrt9zqpv/3/

 

Thanks,

Akash.

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