1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    29
    Vote Rating
    3
    ElCondor1969 is on a distinguished road

      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
    38,412
    Vote Rating
    1103
    Answers
    3682
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default

    Use the onCreateLabel method.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    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
    29
    Vote Rating
    3
    ElCondor1969 is on a distinguished road

      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
    38,412
    Vote Rating
    1103
    Answers
    3682
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    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.

Thread Participants: 1

Tags for this Thread