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

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

2 Answers 129 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Nimmy
Top achievements
Rank 1
Nimmy asked on 29 Oct 2014, 12:17 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 31 Oct 2014, 08:55 AM
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!
 
0
Nimmy
Top achievements
Rank 1
answered on 02 Nov 2014, 01:28 PM
Thank you so much. This is what exactly I was looking for. Kudos!
Tags
Charts
Asked by
Nimmy
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Nimmy
Top achievements
Rank 1
Share this question
or