|
3rd Y axis update with pan/zoom (.net winforms) |
Posted by Kjetil Jasund on Dec-03-2012 18:48 |
|
Hello
I have a 2d line plot with zoom and pan. x, y and y2 axis are updated with zoom and pan
by using these lines:
(In the drawChart
viewer.syncLinearAxisWithViewPort("x", c.xAxis())
viewer.syncLinearAxisWithViewPort("y", c.yAxis())
viewer.syncLinearAxisWithViewPort("y2", c.yAxis2())
How could I get my 3rd y axis to automatically update when I zoom/pan?
I want to write
viewer.syncLinearAxisWithViewPort("y3", c.yAxis(rightAxis))
but i'm not allowed
3rd axis definition and use:
Dim layer4 As LineLayer = c.addLineLayer(dataY4, c.dashLineColor(&H33FF33,
Chart.DashLine), "Pump A Tot.V [l]")
layer4.setXData(dataX4)
' Add the fouth y-axis at 50 pixels to the right of the plot area
Dim rightAxis As Axis = c.addAxis(Chart.Right, 50)
' Add a title on top of the fourth y axis.
rightAxis.setTitle("Volume [l]").setAlignment(Chart.TopRight2)
' Set the axis, label and title colors for the fourth y axis to purple (880088)
' to match the fourth data set
rightAxis.setColors(&H880088, &H880088, &H880088)
' Set the line width to 3 pixels
layer4.setLineWidth(3)
layer4.setUseYAxis(rightAxis)
best regards Kjetil Jasund |
Re: 3rd Y axis update with pan/zoom (.net winforms) |
Posted by Peter Kwan on Dec-04-2012 00:26 |
|
Hi Kjetil,
In your code, the third axis is the rightAxis:
viewer.syncLinearAxisWithViewPort("y3", rightAxis)
Hope this can help.
Regards
Peter Kwan |
Re: 3rd Y axis update with pan/zoom (.net winforms) |
Posted by Kjetil Jasund on Dec-04-2012 13:53 |
|
Works perfect. Thank you. |
Re: 3rd Y axis update with pan/zoom (.net winforms) |
Posted by gang on Jun-21-2013 05:13 |
|
I tried this in my project and unhandled exception occurred. The debug information is below:
System.NullReferenceException: Object reference not set to an instance of an object.
at ChartDirector.WinChartViewer.a(Axis A_0, String A_1, Int32 A_2)
at ChartDirector.WinChartViewer.syncLinearAxisWithViewPort(String id, Axis axis)
I'm developing with C#, WindowsForm application.
Any suggestion? |
Re: 3rd Y axis update with pan/zoom (.net winforms) |
Posted by gang on Jun-21-2013 05:33 |
|
My bad. It is functioning. |
|