Wijmo 5 flex chart not working with knockout foreach binding

I want to dynamically update the values ​​(or add an extra legend item) in my chart, so I cannot use the "hardcoded" html markup from the flexchart example page . the problem is that the foreach binding inside the wjFlexChart block doesn't work at all. here's my code:

View:

<div data-bind="wjFlexChart: { itemsSource: data, bindingX: 'week' }">
      <div data-bind="foreach: $data.legend">
            <div data-bind="wjFlexChartSeries: { name: name, binding: value}"></div>
      </div>
</div>

      


ViewModel:

data = new wijmo.collections.ObservableArray();
weeks = 'wk1,wk2,wk3,wk4,wk5,wk6,wk7,wk8'.split(',');
...
for (var i = 0; i < this.weeks.length; i++) {
   this.data.push({
     week: this.weeks[i],
     legend: [{
        name: 'name1_'+i, 
        value: Math.random() * 10
     },{
        name: 'name2_'+i, 
        value: Math.random() * 10
     }]
   });
}

      

Any ideas?

+3
javascript knockout.js wijmo


source to share


No one has answered this question yet

See similar questions:

0
is there a $ index index iterator for the wjFlexChart binding (wijmo 5 flex chart)?

or similar:

1690
How does data binding work in AngularJS?
18
KnockoutJS value related to data binding
2
Using Knockout Bindings to Return a String
1
Interaction with knockout JS and Wijmo
1
Viewmodel Knockout Recommendations (Multiple Rejection on Failure)
0
knockoutjs foreach not working in Wijmo modal dialog
0
Knockout templates with Wijmo
0
Granular rendering control inside knockout.js 'foreach' control binding
0
How to bind an internal array in a knockout table
0
is there a $ index index iterator for the wjFlexChart binding (wijmo 5 flex chart)?



All Articles
Loading...
X
Show
Funny
Dev
Pics