Results 1 to 4 of 4

Thread: Both slice's name and value in pie chart.

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    33
    Vote Rating
    4
      0  

    Default Unanswered: Both slice's name and value in pie chart.

    Hello to all.
    I have a pie chart and I would like, for each slice of the pie, that the label shows both the name of the slice and its value.
    For example, in my case, the store that feeds the chart has two fields "Name" and "Value".
    The amplitude of each slice is determined by the field "Value". The label of each slice is determined by the "Name" field.
    In practice I have:


    series:
    [
    {
    type: 'pie',
    angleField: 'Value',
    ...
    label:
    {
    field: 'Name',
    display: 'rotate',
    contrast: true,
    font: 'bold 14px Tahoma'
    }
    ]


    But doing so the label of each slice will only show the name of the slice, and I would like to have the value of the slice too (contained in the "Value").
    From what I see, the field "field" in configuration object "label" may contain only the name of one field of the store.
    How can I show both the name and value in slices?
    Thank you in advance for your kind answers.
    Bye!

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,335
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    Use the onCreateLabel method.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    33
    Vote Rating
    4
      0  

    Default

    Hi Mitchell!
    Thank you very much for your kindly reply.
    Ok, I'll use onCreateLabel method.
    But I have still a little doubt. It is not a private method?
    Can I rely on the existence of this method in the future?
    Would not it be better that this method, or an equivalent, is at least protected?

    Thank you very much in advance.
    Bye.

    Sergio.

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,335
    Answers
    3884
    Vote Rating
    1297
      0  
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •