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

JQuery Kendo Chart - Loop Series Data

2 Answers 173 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Sharizan
Top achievements
Rank 1
Sharizan asked on 20 Jul 2017, 02:53 AM

Hi,

May i know how can i loop the series data in JQuery Kendo Chart? I need to loop because i need to check if the series point exceed some limit and i need to change the behavior of the point by changing it label or color. i know there is a parameter called render and we can check the value there.

2 Answers, 1 is accepted

Sort by
0
Accepted
Angel Petrov
Telerik team
answered on 21 Jul 2017, 01:49 PM
Hi,

Changing the color or label on reder is not possible as this event is fired too late. What you can do for chaning the color is to attach a function as shown below.

 JavaScript:
$("#chart").kendoChart({
  series: [{
    data: [1, 2],
    color: function(point) {
      if (point.value > 1) {
        return "red";
      }
 
      // use the default series theme color
    }
  }]
});
By following the above approach you should be able to change the color according to the value.

As for changing the label you can use a template and use conditional logic inside it to do so.

Regards,
Angel Petrov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Sharizan
Top achievements
Rank 1
answered on 24 Jul 2017, 01:51 AM

Hi Angel,

Thank you for the help.

Tags
Charts
Asked by
Sharizan
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Sharizan
Top achievements
Rank 1
Share this question
or