Chart Custom Binding

4 posts, 0 answers
  1. Joachim
    Joachim avatar
    3 posts
    Member since:
    Oct 2010

    Posted 02 Feb Link to this post

    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

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 04 Feb Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Joachim
    Joachim avatar
    3 posts
    Member since:
    Oct 2010

    Posted 11 Feb in reply to Danail Vasilev Link to this post

    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

  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 15 Feb Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready