Callback Data Binding
ShieldChart supports light-weight bindig via callback method. The callback data-binding is enables by setting the
UseCalbackFunction to "true":
<shield:ShieldChart UseCalbackFunction="true" ID="ShieldChart1" Width="100%" Height="400px" runat="server" CssClass="chart" DataSourceID="SqlDataSource1"> <DataSeries> <shield:ChartBarSeries DataFieldY="UnitsInStock"> </shield:ChartBarSeries> </DataSeries> </shield:ShieldChart>
The data when callback binding is used can be obtained via
OnTakeDataSource event or from datasource control.
Initially the chart without data is loaded on the client. Then a callback to the server is fired in order to get data. The
Callback event is raised on the server during server-side processing of the callback. In the event's handler, the required data is obtained and assigned to the
Result property of the event's argument.
Finally, when the response comes back to the client, the client side scripts parse the
JSON response and assign it to the dataseris of the chart.
For more information see Callback Data Binding example.