Only display last label in stack

3 posts, 0 answers
  1. Matt
    Matt avatar
    6 posts
    Member since:
    Mar 2012

    Posted 26 Feb Link to this post

    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. Daniel
    Admin
    Daniel avatar
    2224 posts

    Posted 28 Feb Link to this post

    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.
  3. Matt
    Matt avatar
    6 posts
    Member since:
    Mar 2012

    Posted 28 Feb in reply to Daniel Link to this post

    Thanks for replying. I'm having to go a different route based on our situation, but I appreciate the help.
Back to Top