1. #1
    Sencha User
    Join Date
    Mar 2011
    Location
    Gujarat,India
    Posts
    55
    Answers
    1
    Vote Rating
    0
    nareh tank is on a distinguished road

      0  

    Default Unanswered: problem in pie chart tool tip

    Unanswered: problem in pie chart tool tip


    hello all,

    my pie chart display fine but it's tool tip give wrong percentage.

    plz help me.
    thanks in advance ..

    naresh

  2. #2
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,761
    Answers
    33
    Vote Rating
    108
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    How can we help when we can't see your code. We could try to guess the error but I doubt that will help you.

  3. #3
    Sencha User
    Join Date
    Mar 2011
    Location
    Gujarat,India
    Posts
    55
    Answers
    1
    Vote Rating
    0
    nareh tank is on a distinguished road

      0  

    Default


    i use same code as document.

    Code:
     tips: {
                          trackMouse: true,
                          width: 140,
                          height: 28,
                          renderer: function(storeItem, item) {
                                //calculate and display percentage on hover
                                var total = 0;
                                store.each(function(recode) {
                                    total += recode.get('Users');
                                });
                     this.setTitle(storeItem.get('Month') + ': ' + Math.round(storeItem.get('Users') / total * 100) + '%');
                          }
                   }
    i think problem in recode.get('Users);
    when i alert data of recode.get('Users) it gives wrong data then why chart is correct that's i cant understand.
    i user array of arrays in json_encode function at server side .may be it is the problem.
    but i cant figure out what is the problem.

  4. #4
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,761
    Answers
    33
    Vote Rating
    108
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Can you post your data too, and complete source code?

  5. #5
    Sencha User
    Join Date
    Mar 2011
    Location
    Gujarat,India
    Posts
    55
    Answers
    1
    Vote Rating
    0
    nareh tank is on a distinguished road

      0  

    Default


    Quote Originally Posted by mankz View Post
    Can you post your data too, and complete source code?
    I am generating data dynamically that's why i can't post it here ,but bellow is my comlete code for pie chart

    Code:
    var data = window.data;//this is globle variable which I am using  for store data
    
    var store = new Ext.data.ArrayStore({  
            fields:[{name:'Month'},{name:'Users', type:'float'}]  
            });  
            store.loadData(data[i]);//here I use the array of data that's why data[i] used 
    
    
    var mychart= new Ext.chart.Chart({            width: 600,
                height: 400,
                animate: true,
                store: store,
                
                renderTo:'webforms_form',
             shadow: true,
                legend: {
                    position: 'top'
                },
                series: [{
                    type: 'pie',
                    field: 'Users',
                    showInLegend: true,
                    tips: {
                          trackMouse: true,
                          width: 140,
                          height: 28,
                          renderer: function(storeItem, item) {
                                //calculate and display percentage on hover
                                var total = 0;
                                store.each(function(recode) {
                                    total += recode.get('Users');
                                });
                                this.setTitle(storeItem.get('Month') + ': ' + Math.round(storeItem.get('Users') / total * 100) + '%');
                          }
                   },
                    highlight: {
                      segment: {
                        margin: 20
                      }
                    },
                    label: {
                        field: 'Month',
                      display: 'rotate',
                        contrast: true,
                       },
                    animate: true
                }]
           });

Thread Participants: 1

Tags for this Thread