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

Only display last label in stack

2 Answers 71 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 26 Feb 2019, 07:23 PM

I've been struggling with this for quite a while now with no good results. We are using stacked charts that are built dynamically in javascript from a dataset. I want to only display the last label in the stack (using stackValue in the label template). The issue is that the stack in each category may not have the same number of series displayed.

For example, I am binding 3 series to the chart in a stack with months as my category. October only has a value for 1 series, November has values for all 3 series, December has values for only 2 series.

So I can't just set the last series' labels as visible and the other series as not visible. Is there a way in the labels visible event to see what the last series is in the stack and set the other series labels to hidden?

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 28 Feb 2019, 07:04 AM
Hello,

There isn't a built-in flag that would indicate if the current label is from the last series with value, but it should be possible to determine this by using the indices provided in the argument and the series data - example.

Regards,
Daniel
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Matt
Top achievements
Rank 1
answered on 28 Feb 2019, 07:16 PM
Thanks for replying. I'm having to go a different route based on our situation, but I appreciate the help.
Tags
Charts
Asked by
Matt
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Matt
Top achievements
Rank 1
Share this question
or