Stock Chart Data Binding
This article explains how to provide data to a Stock Chart component, the properties related to data binding and their results.
In this article:
Attach Series Items to Their Categories
You can provide a List<object> to the Data property of a series that contains both its data points, and its x-axis categories. Then, set the following parameters based on the type of the chart:
Column,AreaandLine-FieldandCategoryFieldto the corresponding fields in the model that carry the valuesOHLCandCandlestick-OpenField,ClosedField,HighFieldandLowFieldproperties to the corresponding fields in the model that carry the values. Set theDateFieldparameter of the<TelerikStockChart>to theDateTimeproperty from the model that will be used for the x-axis.
With this, the items from the series will be matched to the items (categories) on the x-axis. Each series will add its own categories to the x-axis in order of appearance, and the series items will appear above them only.
This approach lets you define the
CategoryFieldfor only one series and the rest of the series will match the categories by their index. In such a case, you can provide a single data collection to the chart that holds all data points and x-axis categories.
Examples
Bind a Candlestick Stock Chart to a model
Bind a Column Stock Chart to a model