BarWidthArray

View as Markdown

Definition

An array containing the values of the BarWidth properties of all Bars objects applied to the chart.

Property Value

An array of double variables containing the values of the BarWidth properties of Bars objects on the chart.

Syntax

ChartControl.BarWidthArray[]

Examples

1protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
2{
3 // Assign BarWidthArray to a new array
4 double[] barWidths = chartControl.BarWidthArray;
5
6 double referenceWidth = barWidths[0];
7
8 // Trigger an alert if bar widths on the chart differ
9 foreach (double width in barWidths)
10 {
11 if (width != referenceWidth)
12 Alert("mismatchWidths", Priority.Low, "Bar widths on the chart do not match!", " ", 20, Brushes.White, Brushes.Black);
13 }
14}