PanelIndex

View as Markdown

Definition

Indicates the index of the chart panel in the collection of configured panels.

This property comes from a zero-based index, which is not the same as the panel number displayed in the Indicators window opened from within the chart. The panel number displayed in the Indicators window will equate to ChartPanel.PanelIndex + 1.

Property Value

A int representing the zero-based index of the panel.

Syntax

ChartPanel.PanelIndex

Examples

1protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
2{
3 base.OnRender(chartControl, chartScale);
4
5 // Print the panel's zero-based index
6 Print(String.Format("This panel sits at index {0}", ChartPanel.PanelIndex));
7}

Notice three things in the image below:

  • An indicator containing the example code above is configured on the second chart panel.
  • In the Indicators window, the “Panel” property is set to 2.
  • The output of the example code displays the zero-based index of Panel #2, which is at index 1.

ChartPanel_PanelIndex