1. #1
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    972
    Vote Rating
    105
    Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light

      1  

    Default [4.1.1] Customize chart labels

    [4.1.1] Customize chart labels


    Hi,

    Trying to customize chart labels I have just discovered that only its values are accessible within the renderer function.

    There is the following code within the onPlaceLabel function.
    Code:
    label.setAttributes({
        text: format(storeItem.get(field[index]))
    }, true);
    where "format" is the renderer function.

    I think it would be great to pass, at least, storeItem into the renderer function. Why not?

    Say it's a feature request.

    What do you think?

    Edit:

    Sure, it is possible to find a record going through all Store records using the label value, but, anyways, it looks something which can be improved.

  2. #2
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    972
    Vote Rating
    105
    Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light

      0  

    Default


    Hi,

    Could someone look at this issue?

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      1  

    Default


    It's a good idea for custom renderer functions to be able to have information about their context.

    Just like grid column renderers.

    I will add a story for this.

  4. #4
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    972
    Vote Rating
    105
    Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light

      0  

    Default


    Quote Originally Posted by Animal View Post
    Just like grid column renderers.
    Yes, exactly!

    Thank you, @Animal!

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      1  

    Default


    Ticket EXTJSIV-6723

    I have suggested that it be tackled in the 4.2 release.

  6. #6
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    972
    Vote Rating
    105
    Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light

      0  

    Default


    Thanks for the ticket ID! It will help me to monitor.

  7. #7
    Sencha User
    Join Date
    Nov 2012
    Location
    Noida
    Posts
    7
    Vote Rating
    0
    srinivasan1987 is on a distinguished road

      0  

    Default


    Hi Daniil,

    can you help in this. below is the pie chart creation code. I try to implement which you mention in this post.I cant implement this in my code.i want to hide the Zero values label so that i can avoid the overlapping of labels in chart.

    ExtJs Code:

    Ext.define('StatusTypes', {{
    extend: 'Ext.data.Model',
    fields: [
    {{ name: 'StatusType', type: 'string' }},
    {{ name: 'StatusTypeCount', type: 'int' }}
    ],
    groupField: 'StatusTypeCount'
    }}
    );

    var StatusTypeStore = Ext.create('Ext.data.Store', {{
    model: 'StatusTypes',
    data: [
    {{ StatusType: "OK", StatusTypeCount: {8} }},
    {{ StatusType: "WARNING", StatusTypeCount: {0} }},
    {{ StatusType: "BREACHED", StatusTypeCount: {0} }},
    {{ StatusType: "ERROR", StatusTypeCount: {0} }}
    ]
    }}
    );


    var SimplePieChart =
    Ext.create('Ext.chart.Chart',
    {{xtype: 'chart',
    id: 'chartCmp',
    animate: true,
    store: StatusTypeStore,
    shadow: true,
    legend: {{position: 'right'}},
    insetPadding: 30,
    theme: 'Base:gradients',
    series: [{{type: 'pie',
    field: 'StatusTypeCount',
    showInLegend: true,
    donut: false,
    label: {{field: 'StatusType',
    display: 'rotate',
    contrast: true,
    font: '12px Arial',
    }}
    ,
    tips: {{trackMouse: true,
    width: 140,
    height: 28,
    renderer: function(storeItem, item) {{//calculate percentage.
    var total = 0;
    StatusTypeStore.each(function(rec) {{total += rec.get('StatusTypeCount');}});
    this.setTitle(storeItem.get('StatusType') + ': ' + Math.round(storeItem.get('StatusTypeCount') / total * 100) + '%');
    }}
    }}
    ,
    highlight: {{ segment: {{margin: 25}}}}


    }}]
    }}
    );

  8. #8
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    972
    Vote Rating
    105
    Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light

      0  

    Default


    Hi @srinivasan1987,

    Thank you for the question, but it is rather not tightly related to the topic of the current thread.

    I can recommend you to start a new forum thread in the Q&A forum.
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  9. #9
    Sencha User Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    972
    Vote Rating
    105
    Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light Daniil is a glorious beacon of light

      0  

    Default


    I see the signature of a renderer has been changed.
    http://docs.sencha.com/ext-js/4-2/#!...abel-cfg-label

    Now it has a sufficient set of things to configure a label as needed.

    Thank you!
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar