This project is read-only.

Multiple Y axis plot scale issue

Apr 16, 2015 at 7:59 AM
I want to plot multiple y-axis line chart. I tried it with injected plotter and able to plot multiple Y axis.
Though I can plot the multiple lines in the chart, but the reference of scale taken by each line is from Major y-axis. And the other Y-axis range is in multiplication of major y-axis.

My Y-axis range is from 0-100, where as other Y-axis range is not defined. Other Y axis range can be between 0 to 350 or 1 to 375.

Thanks in advance.

Apr 16, 2015 at 8:48 AM
Hi Abhishek,

you can use SetYMapping to overcome this issue
yourYaxisDataSource.SetYMapping(y=> ((y-ymin)*(MainYAxisYMax-MainYAxisYMin)/(ymax-ymin)) + MainYAxisYMin);

here in your case ymin =0 or 1, ymax = 350 or 375, MainYAxisYMax = 100, MainYAxisYMin =0
sure this will work. try this.

Apr 16, 2015 at 1:09 PM
Hello Ravi,

Thank you for your reply.
My problem is that, while plotting the chart, I have no idea about the min and max value of the chart. It is a live data.

Also, the line data are taking reference of Main vertical axis.

Basically, I want multiple line graph with different scale range to be plotted against single x axis.

Apr 21, 2015 at 7:11 AM
Hi Abhishek,

In order to get the different scale you have to use SetYMapping. Then only you will get the different scale. Else all the lines will be mapped to the Main vertical axis scale.
You are saying you don't have min and max. You are already plotting line, means you have data. It is not diffucult to find min and max from existing data.
Find min and max from existing data. Use setYMapping, then you will get differenet scale.

Apr 22, 2015 at 2:57 PM
Hi Ravi,
Thanks for your reply. I was able to generate the multiple axis graph now.
But it seems to be that the x-axis is tightly binded with main y-axis.
When I scroll x-axis, only y-axis graph moves, Y1 and Y2 axis graph remains at same position.
Also, I need to show the value of marker position on mouse move for all graph lines.

Aug 4, 2015 at 1:03 PM
Hi Abhishek,

Sorry for the late reply. I hope you have solved this issue. If not try to set the Viewport.Visible for all injected plotters.
Check your Horizontal X axis is common for all injected plotters.

Dec 14, 2016 at 4:43 AM
could you help me ? my question :the majorlabels is very long compare the x axis ,my chary plotter is not drag and move , what should i do ?
Thank you ?
a new boy for d3.