You can add double values to the Chart control without using a data source.
Return to the overview at Connecting to Data.
Using Code
Use the Values property of the series to add data.
Example
The following example demonstrates adding unbound data to the control.
C# | Copy Code |
---|---|
BarSeries series = new BarSeries();
series.Values.Add(2.0);
series.Values.Add(4.0);
series.Values.Add(3.0);
series.Values.Add(5.0);
|
VB | Copy Code |
---|---|
Dim series As New BarSeries() series.Values.Add(2.0) series.Values.Add(4.0) series.Values.Add(3.0) series.Values.Add(5.0) |
Using the Chart Designer
- Select the PlotArea Collection editor.
- Select the Series Collection editor.
- Select the Values Collection editor.
- Set values as needed.
- Select Apply and OK to close the Chart Designer.