1. #1
    Sencha User
    Join Date
    Mar 2013
    Posts
    3
    Vote Rating
    0
    steph09 is on a distinguished road

      0  

    Default how to present the retrieved data on a sencha pie chat, please! Desparetly need tips

    how to present the retrieved data on a sencha pie chat, please! Desparetly need tips


    Please, i have been searching every where for someone to help me out cos it has not been possible for me to present the data sent to my sencha pie chart from the json data store i created for this purpose :


    I am displaying the below result from a printed form of my variable array countaining the following set of value:
    Array ([0] => Array ( [0] => 19 [nombre] => 19 [1] => Chargé de mission [type] => Charge de mission )[1] => Array ( [0] => 204 [nombre] => 204 [1] => Pré-adhérent [type] => Pre-adherent )[2] => Array ( [0] => 1 [nombre] => 1 [1] => Administrateur [type] => Administrateur )[3] => Array ( [0] => 25 [nombre] => 25 [1] => Auto-entrepreneur [type] => Auto-entrepreneur )[4] => Array ( [0] => 1157 [nombre] => 1157 [1] => Adhérent [type] => Adherent )[5] => Array ( [0] => 429 [nombre] => 429 [1] => Salarié [type] => Salarie ))


    meanwhile to send it to my sencha pie i have use the json encode as bellow:


    {"success":true,"total":"0","data":[{"0":"19","nombre":"19","1":null,"type":"Charge de mission"},{"0":"204","nombre":"204","1":null,"type":"Pre-adherent"},{"0":"1","nombre":"1","1":"Administrateur","type":"Administrateur"},{"0":"25","nombre":"25","1":"Auto-entrepreneur","type":"Auto-entrepreneur"},{"0":"1157","nombre":"1157","1":null,"type":"Adherent"},{"0":"429","nombre":"429","1":null,"type":"Salarie"}]}


    However to have it displayed by the sencha pie i have set my code as follow :


    var userStore = new Ext.data.JsonStore({
    url: 'rapport/chartTypeProfils.php',
    fields: [{name:'nombre' ,type:'int'},'type'],
    root: 'data'
    //totalProperty:'total'


    });






    userPie= Ext.extend( Ext.ux.Portlet,{
    constructor: function(config) {
    Ext.apply(this, {
    //width: 400,
    height: 300,
    title: 'Utilisateur',
    tools: tools,
    //renderTo: 'user',
    items: {
    itemId: 'userStore',
    store: userStore,
    xtype: 'piechart',
    dataField: 'nombre',
    categoryField: 'type',
    //extra styles get applied to the chart defaults
    extraStyle:
    {
    legend:
    {
    display: 'left',
    padding: 5,
    font:
    {
    family: 'Tahoma',
    size: 13
    }
    }
    }
    }
    });
    userPie.superclass.constructor.apply(this, arguments);
    }
    });


    but it doesn't seem to work as to display the wanted pie.....

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    898
    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


    What do you mean? Is it displaying something just not what you want or not displaying at all?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 2013
    Posts
    3
    Vote Rating
    0
    steph09 is on a distinguished road

      0  

    Default


    Thanks in advance for your immediate reaction mitchellsimoens,

    It is not showing at all..... and still can't seem to understand the reason why and would sincerely appreciate helps on figuring out the reason of the why i've been confronted to this issue, please......

Thread Participants: 1