ChartDirector 6.2 (.NET Edition)



[C#] public void syncLinearAxisWithViewPort(string id, Axis axis);
[VB] Public Sub syncLinearAxisWithViewPort(id As String, axis As Axis)


Synchronizes a linear Axis with the part of the data scale in viewport.

If the data scale has already been defined (see WebChartViewer.setFullRange on how to define a data scale), this method will compute the visible data scale based on the viewport coordinates using linear interpolation, and then sets the axis to that linear scale.

If the data scale has not been defined, this method will define the data scale based on the axis scale and the the viewport coordinates using linear extrapolation. Because the axis scale may not be known at the time of calling this method (the axis could be auto-scaled by ChartDirector, which may not occur until the chart is rendered), the definition of the data scale will not occur immediately, but will be pending until the chart is to be displayed.

If your charting code calls this method but never defines the full data scale or the viewport coordinates (in which case the viewport defaults to showing the complete data scale), then the first time the code is executed, the data scale will be defined to be equal to the axis scale. Subsequently, when the user zooms into the chart (which means the viewport coordinates are changed), the same charting code will set up the axis scale to the range that the user has zoomed to.


id(Mandatory)The name of the data scale.
axis(Mandatory)The Axis object to synchronize with.

Return Value