Class

ChartLinearDataset


Description

The dataset used for charts that require linear data such as Bar, Line and Pie.

Methods

Name

Parameters

Returns

Shared

AddRow

Value As Double

AddRowAt

Index As Integer, Value As Double

Constructor

Label As String, DataColor As Color, Fill As Boolean, ParamArray Datapoints() As Double

Count

Integer

LastIndex

Integer

RemoveAllRows

RemoveRowAt

Index As Integer

RowAt

Index As Integer

Double

Enumerations

ChartLinearDataset.ChartTypes

ChartTypes

The various types of charts that can be used to represent the dataset.

Enum

Description

Bar

A chart made up of bars the height of each represents a data point in the dataset.

Default

A Bar chart. As default, this type will be chosen if you don't choose one.

LineType

A chart made up of connected lines that represent each data point in the dataset.

Property descriptions


ChartLinearDataset.ChartType

ChartType As ChartTypes

The various types of charts that can be created from the data set.


ChartLinearDataset.CornerSize

CornerSize As Double

The height of the corners when drawing rectangles in the chart.


ChartLinearDataset.DataColor

DataColor As Color

The color to be used when drawing the graphics in the chart that represent the dataset.


ChartLinearDataset.Fill

Fill As Boolean

If True, the graphical object in the chart that represents the data will be filled in with a color.


ChartLinearDataset.Label

Label As String

The label that will appear in the chart with the graphics that represent the dataset.


ChartLinearDataset.Prefix

Prefix As String

The prefix text for the values displayed in the Y axis.


ChartLinearDataset.Style

Style As ChartLinearStyle

The style for the value's endpoint and drawing of the connection line between values.


ChartLinearDataset.Suffix

Suffix As String

The suffix text for the values displayed in the Y axis.


ChartLinearDataset.Tag

Tag As Variant

A place to store data associated with the dataset.


ChartLinearDataset.Transparency

Transparency As Double

Controls the level of transparency of the data when drawn. 0 is fully opaque. 100 is fully transparent.

Important

This is not yet supported by WebChart.

Method descriptions


ChartLinearDataset.AddRow

AddRow(Value As Double)

Adds the value passed to the dataset.


ChartLinearDataset.AddRowAt

AddRowAt(Index As Integer, Value As Double)

Adds the value passed to the dataset at the index passed.


ChartLinearDataset.Constructor

Constructor(Label As String, DataColor As Color, Fill As Boolean, ParamArray Datapoints() As Double)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a new ChartLinearDataset from the values passed.

This examples uses the constructor to create a new dataset and then assign it to the chart:

Var sales() As Double = Array(345890.0, 421934, 456908, 567987)
Var ds As New ChartLinearDataset("Sales", Color.Blue, True, sales)
SalesChart.AddDataset(ds)
SalesChart.AddLabels("Q1", "Q2", "Q3", "Q4")

ChartLinearDataset.Count

Count As Integer

Returns the number of values in the dataset.


ChartLinearDataset.LastIndex

LastIndex As Integer

Returns the index of the last value in the dataset.


ChartLinearDataset.RemoveAllRows

RemoveAllRows

Removes all the rows (data) from the dataset.


ChartLinearDataset.RemoveRowAt

RemoveRowAt(Index As Integer)

Removes the row (data) at the index passed from the dataset.


ChartLinearDataset.RowAt

RowAt(Index As Integer) As Double

Returns the row value at the index passed.

Sample code

This example uses a ChartLinearDataset to present some data in a bar chart. Because ChartLinearDataset requires the data to be of type Double, when using the Array function you must add a decimal to one of the values so that Array knows to return a Double rather than an Integer array.

Var sales() As Double = Array(345890.0, 421934, 456908, 567987)
Var ds As New ChartLinearDataset("Sales", Color.Blue, True, sales)
Me.AddDataset(ds)
Me.AddLabels("Q1", "Q2", "Q3", "Q4")

Compatibility

Desktop, Mobile and Web projects on all supported operating systems.

See also

ChartDataset parent class; Chart control, ChartDataset, ChartCircularDataset and ChartScatterDataset classes.