Controlling Left Axis scale with Right Axis
I had a need for a bar and line chart in one graph with the Left X Axis for the bars (big numbers) and the Right X Axis for the line (small numbers). Once I got all that worked out the scaling for the line graph was following its own rules and looking as big bar chart numbers. I found the "Share the scale with another chart or axis" but this made it so the line part of the graph was just a striaght line at the bottom.
What I needed was for the Left Axis to be controlled by the Right Axis but by a factor.
This is what I came up with and it woking quite nicely.
On the chart Data Changed script (put here because like most chart it has a filter and the right axis scale changes depending on what is selected).
Put this simple script:
chart1.control.y2Axes["0"].autoMaximumLowerLimit = chart1.control.yAxes["0"].actualMaximum/2;
I at first had this to help me dig into all the parts (using the Browser developer tools) and figure out what is was I needed to do.
debugger;
var axesRight = chart1.control.y2Axes;
var axesLeft = chart1.control.yAxes;
var max = axesLeft["0"].actualMaximum; //so I could run in debugger and see the value, looked at many different things with that.
axesRight["0"].autoMaximumLowerLimit = axesLeft["0"].actualMaximum/2;
You might not need this one linner script but the process that I went trough to find what I was looking for might be what you need. By looking at the API Docs and saying that sounds like what I need but it was not when I actually ran it in the debugger and saw that not the value I am expecting. Then going back through the list (some times the list is short and others there are a lot of simular sounding like in dundas.controls.ChartAxis).
Reminder: Try to remeber to cleaned up your "Trying Things Out Code" into production code.