Mess Labels on Stacked Bars

9 posts, 1 answers
  1. Daihua
    Daihua avatar
    6 posts
    Member since:
    Aug 2012

    Posted 10 Aug 2012 Link to this post

    Hi,

    For drawing stacked bars chart, the labels in SeriesDefaults obeject looks mess for some data. I wanna know whether there is a way show the sum of the data of all stack data as label instead of showing data for each bar. For example, in my code, on 08/12 date, active: 24216, idle: 2030. The total of both is 26246. Can I just show this total number on top of the bar? How can I do that. Thanks.

    This is my code:
    http://jsfiddle.net/fAQXq/2/ 
  2. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 13 Aug 2012 Link to this post

    Hello Daihua Ye,

    1) You can change the position of the labels with position property. For example: 

    ...
    labels: {
       position: "center"
    }
    ...

    2) Currently total label for the bar chart is no supported. I would suggest to submit your request in Kendo's UserVoice so other members of the community can evaluate, comment on and vote for it.

    Greetings,
    Hristo Germanov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Daihua
    Daihua avatar
    6 posts
    Member since:
    Aug 2012

    Posted 13 Aug 2012 Link to this post

    Thanks Hristo Germanov. 
  4. Daihua
    Daihua avatar
    6 posts
    Member since:
    Aug 2012

    Posted 17 Aug 2012 Link to this post

    Hi Hristo,

    I found a new problem for the label. Recently I want to put it in the mobile device and when resize the chart it become less readable. Do you have any ways to work around the label? The labels are overlap. 

    One thought: Can I replace those labels with one label on top of the bar? I have an array for the category of labels. I want to use it instead of the data of the bar. For example, mine graph is stack bar, and each bar has value and they are show as labels. Now I have an array for label and only want to display only once on the top of bar. In the demo, there are 7 bar, and 14 labels. I want to replace the 14 labels with 7 labels. Those labels will display on top of each bar. Is it clear? 

    Here is the link to my demo: 
    http://jsfiddle.net/davishacker/FhAMB/1/

    Thanks again.
  5. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 20 Aug 2012 Link to this post

    Hello Daihua Ye,

    Can you examine the modified example and tell me if it works for you.

    Kind regards,
    Hristo Germanov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Daihua
    Daihua avatar
    6 posts
    Member since:
    Aug 2012

    Posted 20 Aug 2012 Link to this post

    Hi Hristo,

    Check out this new demo, in the demo, I add a new array with length 7. It is going to use that array as label. The new array is the sum corresponding to the bar data. Also, I don't want to draw the bar for the new array. Is it possible

    Alternative link: http://jsfiddle.net/davishacker/FhAMB/8/ 

    Best,
    Daihua
  7. Answer
    Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 23 Aug 2012 Link to this post

    Hi Daihua Ye,

    Could you please examine this demo and tell me if it works for you.

    Regards,
    Hristo Germanov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Daihua
    Daihua avatar
    6 posts
    Member since:
    Aug 2012

    Posted 23 Aug 2012 Link to this post

    Hi Hristo,

    Your demo is what I want. Thanks so much. 
  9. jwize
    jwize avatar
    66 posts
    Member since:
    Mar 2013

    Posted 24 Jun 2013 Link to this post

    Hi there, 
    Can you please give a demo for this solution using the datasource syntax  read from the server?

    Thanks!
Back to Top