1. #1
    Sencha User
    Join Date
    Jan 2011
    Posts
    8
    Vote Rating
    0
    lehoangel is on a distinguished road

      0  

    Default Unanswered: ExtJS Chart Update

    Unanswered: ExtJS Chart Update


    Hi I'm new to Extjs Chart, and this one doesn't have a proper API, so I'd need some helps to use it.
    This is my Chart Window with a toolbar and a chart.
    Code:
    /* ----- Chart Window -----*/
            var chartWindow = new Ext.Window({
                height: 300,
                width: 600,
                id: 'chartWindow',
                modal: true,
                title: 'Performance Chart',
                tbar: [{
                    xtype: 'tbbutton',
                    text: core.fuelConsumption,
                    handler: function(){
                        // change chart display
                    }
                   },'-',{
                    xtype: 'tbbutton',
                    text: core.totalDistance,
                    handler: function(){
                             // change chart display
                       }
                    },'-',{
                     xtype: 'tbbutton',
                     text: core.moveTime,
                     handler: function(){
                           // change chart display
                     }
                   },'-',{
                    xtype: 'tbbutton',
                    text: core.stopTime,
                    handler: function(){
                           // change chart display
                    }
                   }],
                items: [performanceChart]
            });
    And here is my chart store & config:

    Code:
    var store = new Ext.data.JsonStore({
                fields : [ 'id', 'plateNumber', 'routeNumber', 'routeName', 'fuelConsumption', 'totalDistance',
                        'moveTime', 'stopTime' ],
                data: [{'id':'0','plateNumber':'29E-6868',
                        'fuelConsumption':'1000','totalDistance':'20','moveTime':'10','stopTime':'1'},
                        {'id':'1','plateNumber':'29E-9999',
                            'fuelConsumption':'2000','totalDistance':'40','moveTime':'20','stopTime':'2'}]
            });
    Code:
    var performanceChart = new Ext.chart.ColumnChart({
                store: store,
                id: 'performanceChart',
                xField: 'plateNumber',
                xAxis: new Ext.chart.CategoryAxis({
                    title: core.plateNumber
                }),
                yField: 'fuelConsumption',
                yAxis: new Ext.chart.NumericAxis({
                    title: 'litre'
                })
            });
    I'd like to have do a small action like this but don't know how.
    - User click on a toolbar button, for example: 'Total Distance', the chart change yAxis to 'km' and yField to totalDistance.
    - Another small thing is that I want to change the fuelConsumption text to vertical display, so it doesn't take much space in the window.

    Thank for your helps.

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    8
    Vote Rating
    0
    lehoangel is on a distinguished road

      0  

    Default


    LOL, I've solved it, the solution is quite simple

    Code:
    performanceChart.setYField('fuelConsumption');
                        performanceChart.setYAxis(new Ext.chart.NumericAxis({
                               title: 'Litre'
                           }));

Similar Threads

  1. extjs chart - on right click can i print the chart
    By vijaypatil12 in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 26 May 2011, 11:53 AM
  2. Update column chart color.
    By vakillanet in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 19 Jul 2010, 9:16 AM
  3. Any update to Chart API
    By babyblue in forum Ext GWT: Discussion
    Replies: 1
    Last Post: 16 Jun 2010, 6:17 PM
  4. [FIXED-536] Chart update SWF update
    By extjs@peacetech.com in forum Ext 3.x: Bugs
    Replies: 5
    Last Post: 17 Feb 2010, 9:45 AM
Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi