Scales

View as Markdown

Definition

A collection of ChartScale objects corresponding to objects within the chart panel.

Property Value

A ChartScaleCollection containing ChartScale objects.

Syntax

ChartPanel.Scales

Example

1protected override void OnStateChange()
2{
3 if (State == State.Historical)
4 {
5 // loop through each panel which is currently configured on the hosting chart
6 foreach (ChartPanel chartPanel in ChartControl.ChartPanels)
7 {
8 // there are multiple scale per panel
9 // i.e., Right, Left, Overlay
10 foreach (ChartScale scale in chartPanel.Scales)
11 {
12 // get the right scale margin type
13 if (scale.ScaleJustification == ScaleJustification.Right)
14 {
15 Print(string.Format("The Right Scale of panel #{0}'s margin type is {1}",
16 scale.PanelIndex, scale.Properties.AutoScaleMarginType));
17 }
18 }
19 }
20 }
21}
1protected override void OnStateChange()
2{
3 if (State == State.Historical)
4 {
5 // Shows us at which index in the Scales collection the individual panel scales reside [0: Right, 1: Left, 2: Overlay]
6 // The Scale collection gets accessed via passing the ScaleJustification enum in as index
7 Print("Scales index " + 0 + " " + ChartPanel.Scales[ScaleJustification.Right]);
8 Print("Scales index " + 1 + " " + ChartPanel.Scales[ScaleJustification.Left]);
9 Print("Scales index " + 2 + " " + ChartPanel.Scales[ScaleJustification.Overlay]);
10 }
11}