Results 1 to 9 of 9

Thread: Any Issues with Pie Chart, Please help.

  1. #1

    Default Any Issues with Pie Chart, Please help.

    Hi, I am not sure if this is reported as a bug but I am looking for some help to display the pie chart. The pie chart creation , its data store and the JSON response is shown below.

    Code:
    var piecht = new Ext.Panel({
            iconCls:'chart',
            title: 'ExtJS.com',
            frame:true,
            width:600,
            height:300,
            layout:'fit',
            items: {
                xtype: 'piechart',
                store: firstchartstore,
                dataField: 'value'                    
            },
             url:'/ext-3.0-rc1/resources/charts.swf'                  
        });
    
       var firstchartstore = new Ext.data.JsonStore(
        {                   
                fields: [ 
                       ,{name: 'key', type: 'string'}                  
                       ,{name: 'value', type: 'int'}             
                    ],
                    root: 'firstchart.chartData'
                                
        });
    
    function LoadAndShow(combovalue,clientcombo){
        firstchartstore.on('load', loadSuccessfulChart);
        piecht.render(document.getElementById('pchart'));
        -- prepare the URL String 
        Ext.Ajax.request({    
                url:  urlStr,
                success: function(response) {
                    var data = Ext.decode(response.responseText);                  
                    firstchartstore.loadData(data);
                    
                }
            });
        } 
    
      function loadSuccessfulChart(store, recordArray, options) {
       alert("chart store loaded");    
       }
    
    JSON RESPONSE - 
    {"firstchart":{"chartData":[{"key":"BLACKRCK","value":2983},{"key":"GSAM2","value":542}],"message":"Successfully
     retrieved chart data","success":true}}

  2. #2
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Question

    Perhaps an explanation of the problem ?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  3. #3

    Default

    Oops, I missed. The pie chart does not display at all.

  4. #4
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    Try RC2 and/or defeat SWF caching by making the url unique:

    url:'/ext-3.0-rc1/resources/charts.swf?_dc='+new Date().getTime()
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  5. #5

    Default

    I made changes to the URL but no use. I am sorry but I did not get you when you wrote to try RC2 . What does this mean ?

  6. #6
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966

    Default

    Quote Originally Posted by ektanit View Post
    I made changes to the URL but no use. I am sorry but I did not get you when you wrote to try RC2 . What does this mean ?
    Are you using Ext 3. RC2?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  7. #7

    Default

    I tried even with RC2.
    The column chart comes up so nice but the pie chart never shows up.
    I really need this to work as I love the Ext js framework and would want my application to port on extjs.

  8. #8

    Default

    see here- I had put the same data as what seen in JSON response and the pie chart comes up but when the store is configured to understand the JSON response, it does not show the pie chart. What is the problem here ?

    Code:
    // This comes up
    var firstchartstore = new Ext.data.JsonStore({
                    fields:['key', 'value'],
                    data:[{"key":"BLACKRCK","value":2983},{"key":"GSAM2","value":542}]             });
                
    // This does not
        /*var firstchartstore = new Ext.data.JsonStore(
        {   
            fields:['key', 'value'],
            root: 'firstchart.chartData'
                                
        });
        */
    
    This is how I load the store.
    
    function LoadAndShow(){
        firstchartstore.on('load', loadSuccessfulChart);
        -- prepare the URL String urlStr
        Ext.Ajax.request({    
                url:  urlStr,
                success: function(response) {
                    var data = Ext.decode(response.responseText);                  
                    firstchartstore.loadData(data);                
                }
            });
        } 
    
      function loadSuccessfulChart(store, recordArray, options) {
       alert("chart store loaded");    
    
       }
    
    
    My JSON response as seen in firebug is
    
    {"firstchart":{"chartData":[{"key":"BLACKRCK","value":2983},{"key":"GSAM2","value":542}],"message":"Successfully
     retrieved chart data","success":true}}

  9. #9

    Default

    Hi, Can I get a reply on this..gurus please help. I read from an earlier post today that you are doing another release this week for EXTJS3.0 bug fixes. I am not sure if this is my problem because of some silly mistake .

Posting Permissions

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