ComponentOne FlexChart for WinForms
Axis Binding
FlexChart > Working with FlexChart > FlexChart Elements > Axis > Axis Binding

Axis binding enables you to override the default axis labels that the axis display based on the chart binding. In other words, axis binding lets you show Axis labels from a data source other than the chart data source.

FlexChart allows you to bind axis to a data source using the DataSource property of the Axis class. Specify the fields containing values for the axis labels in the data source using the Binding property of the Axis class.

The following image displays labels on Y-axis from the fields not part of the chart data source.

The following code uses revenue data of an organization in a given year. The chart datasource contains the revenue data in the Euro currency. To replace euro currency axis labels with USD currency labels, the code binds Y-axis to a data source containing USD data.

' bind Y axis to a data source
FlexChart1.AxisY.DataSource = axisDataSource

' specify fields containing values for axis labels
FlexChart1.AxisY.Binding = "Value,Text"
// bind Y axis to a data source
flexChart1.AxisY.DataSource = axisDataSource;
// specify fields containing values for axis labels
flexChart1.AxisY.Binding = "Value,Text";