Data-binding options:
Example:
In this example, the ViewModel is defined specifically for use with the bar chart. It has disabled, stacked and seriesList properties that are bound in the View. If any of these values change, then the widgets will automatically respond to them. The widgets also update the ViewModel values as they modify them. This chart is a stacked bar chart with the seriesList specified in the ViewModel.
Create a ViewModel:
ViewModel Script |
Copy Code |
---|---|
var viewModel = { seriesList: ko.observableArray([createRandomSeriesList('legend' + index)]) }; |
Create View with Bound Controls:
View Markup |
Copy Code |
---|---|
<div id="wijbubblechart" data-bind="wijbubblechart: { seriesList: seriesList }" style="width:600px;height:400px;"> </div> |