How to get Total, High, Low, Avg Values from a Bar chart

3 posts, 1 answers
  1. Nimmy
    Nimmy avatar
    3 posts
    Member since:
    Oct 2014

    Posted 29 Oct 2014 Link to this post

    Hi,

    I want to get Total, High, Low, Avg Values from a Bar chart. My chart will display the graph based on days, weeks and months base units on the drop down selection. So the values should change with Daily, Weekly and Monthly graph Any want to draw a line through the Avg value of the Value Axis. Refer the attached image. Any help would be appreciated. 

    Thanks,
    Nimmy
  2. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2817 posts

    Posted 31 Oct 2014 Link to this post

    Hi,

    If I understand correctly, you'd like to display summary of the data that is actually visible in the chart.

     The chart doesn't offer much in terms of queries over the plotted data, but it is possible to access it.

    This currently requires handling the dataBound event and using a setTimeout to defer the execution until the data is available.
    This is something that we'll amend by adding a dedicated "render" event.

    $("#chart").kendoChart({
      dataBound: updateTotals,
      ...
    });

    function updateTotals(e) {
      setTimeout(function() {
          var data = e.sender._plotArea.series[0].data;
          ...
        });
    }

    I've prepared a snippet to demonstrate this approach. Hope this helps.

    Regards,
    T. Tsonev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Nimmy
    Nimmy avatar
    3 posts
    Member since:
    Oct 2014

    Posted 02 Nov 2014 in reply to T. Tsonev Link to this post

    Thank you so much. This is what exactly I was looking for. Kudos!
Back to Top