Plots

View as Markdown

Definition

A collection holding all of the Plot objects that define their visualization characteristics.

Property Value

A collection of Plot objects.

Syntax

Plots**[int index]

The example code below will change the color of an entire plot series. See PlotBrushes for information on changing only specific segments of a plot instead.

Examples

1protected override void OnStateChange()
2{
3 if(State == State.SetDefaults)
4 {
5 Name = "Examples Indicator";
6 // Lines are added to the Lines collection in order
7 AddPlot(Brushes.Orange, "Plot1"); // Stored in Plots[0]
8 AddPlot(Brushes.Blue, "Plot2"); // Stored in Plots[1]
9 }
10}
11
12// Dynamically change the primary plot's color based on the indicator value
13protected override void OnBarUpdate()
14{
15 if (Value[0] > 70)
16 {
17 Plots[0].Brush = Brushes.Blue;
18 Plots[0].Width = 2;
19 }
20 else
21 {
22 Plots[0].Brush = Brushes.Red;
23 Plots[0].Width = 2;
24 }
25}