This is a migrated thread and some comments may be shown as answers.

Chart Custom Binding

3 Answers 86 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Joachim
Top achievements
Rank 1
Iron
Joachim asked on 02 Feb 2016, 05:34 PM

Hello everyone,

I've tried to add a custom binding to a scatterLine chart, but chrome just throws an exception:

"Uncaught Error: The chartSeries binding is not supported by the Chart widget"

 

Is it possible to do something similar to the following?

<div id="mychart" data-bind="chartSeries: Series"></div>

 

kendo.data.binders.chartSeries = kendo.data.Binder.extend({
    refresh: function() {
        var serieses = this.bindings["chartSeries"].get();
  
        //my irrevevant stuff
  
        $(this.element).redraw();
    }
});
  
function GetAllPageElements () {
    var PrintChart = function () {
        $("#mychart").kendoChart({
                  //my irrevevant stuff
        });
    };
      
    PrintChart();
}
  
$(document).ready(function () {
    var ChartViewModel = new ViewModels.ChartVm();
    GetAllPageElements();
    kendo.bind($("#chartView"), ChartViewModel);
});

 Thanks for your help!

Joachim

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 04 Feb 2016, 11:22 AM
Hello Joachim,

Thank you for contacting us.

As the mentioned error states - chartSeries binding is not supported by the chart widget. Currently the chart widget supports events, data source and visible bindings. You can see a live example here - http://demos.telerik.com/kendo-ui/area-charts/mvvm

Let me know if I can assist you further with our products.

Regards,
Danail Vasilev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Joachim
Top achievements
Rank 1
Iron
answered on 11 Feb 2016, 10:37 AM

hi Danail,

Thank you for your answer.

So there isn't any possiblility to add custom binding to kendo UI controls, is it?

The problem i've got is, that i can't bind my data directly to the chart as a datasource.

That's because my value axis must be added and removed dynamically when different data should show up in the chart.

I hope this was understandable :)

it's not importent to me how to solve the problem, but it should be usable via MVVM.

 

Regards,

Joachim

0
Danail Vasilev
Telerik team
answered on 15 Feb 2016, 07:03 AM
Hello Joachim,

Yes, series binding is not supported by the chart. You can try to attach to a particular event (e.g., render) where you can set the desired options for the axes.

Regards,
Danail Vasilev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Charts
Asked by
Joachim
Top achievements
Rank 1
Iron
Answers by
Danail Vasilev
Telerik team
Joachim
Top achievements
Rank 1
Iron
Share this question
or