FromIndex

View as Markdown

Definition

An index value representing the first bar rendered on the chart. See also ToIndex.

This value is NOT the first value that exists on the ChartBars, but rather the first bar index that is within the viewable range of the chart canvas area. This value changes as the user interacts with the ChartControl time-scale (x-axis).

Property Value

An int representing the first bar index painted on the chart.

Syntax

ChartBars.FromIndex

Examples

1protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
2{
3 if (ChartBars != null)
4 {
5 // loop through all of the viewable range of the chart
6 for (int barIndex = ChartBars.FromIndex; barIndex <= ChartBars.ToIndex; barIndex++)
7 {
8 // print the High value for each index within the viewable range
9 Print(High.GetValueAt(barIndex));
10 }
11 }
12}