1. #1
    Sencha User kantha.exe's Avatar
    Join Date
    May 2012
    Location
    India, Banglore
    Posts
    24
    Vote Rating
    -1
    kantha.exe is an unknown quantity at this point

      0  

    Default Unanswered: Problem with Grouped Chart...In extjs4

    Unanswered: Problem with Grouped Chart...In extjs4


    Hi Everybody....

    Actually I am working with Grouped Bar-Chart in ext4 ...

    in grouped chart i am displaying 3 series which of different values, What i want to do is i need to
    get Click Event on each bar series and i should get value of that bar...(each BAR)....

    my piece of code look like this...

    // ----------- Chart Code -------------- //

    {
    id: 'chartCmp',
    xtype: 'chart',
    style: 'background:#fff',
    animate: true,
    shadow: true,
    x: 200,
    y: 250,

    width: 700,
    height: 500,
    minHeight: 500,
    minWidth: 500,

    store: ChartStore,
    legend: {
    position: 'right bottom'
    },

    axes: [{
    type: 'Numeric',
    position: 'bottom',
    fields: ['newCount','repeatedCount','deviationCount'],

    minimum: 0,
    label: {

    },
    grid: true,
    title: 'Risk Catagory'
    }, {
    type: 'Category',
    position: 'left',
    fields: ['auditReportNum'],
    title: 'Audit Report Number'
    }],

    series: [{
    type: 'bar',
    axis: 'bottom',
    xField: 'auditReportNum',
    yField: ['newCount','repeatedCount','deviationCount'],
    highlight: true,

    highlightCfg: {
    fill: '#a2b5ca'
    },

    /* tips: {
    trackMouse: true,
    width: 140,
    height: 100,
    renderer: function(storeItem, item) {
    this.setTitle('New '+storeItem.get('newCount'));

    this.setTitle(' High :'+ Math.round(storeItem.get('highCount') / 4 * 100)
    +'%'+ '</br>Low :'+Math.round(storeItem.get('lowCount')/4*100)
    +'%'+'</br>Medium :'+Math.round(storeItem.get('mediumCount')/4*100)+'%'
    +'</br> Recommended :'+Math.round(storeItem.get('recommendedCount')/4*100)+'%');
    }
    },*/
    listeners: {
    trackMouse: true,
    'itemmouseup': function(storeItem, item) {


    alert(item.get('newCount'));




    //barChartStore.loadData(record.get('depBreakdown'));

    /* var rec = ChartStore.getAt(o.index);
    alert(" REcord "+rec+o.index);


    alert(rec.get('newCount'));*/
    // Ext.example.msg('Testing', 'You selected {0}.', rec.get('newCount'));
    }
    }
    }]

    // --------------- End : Chart Code ------------------ //


    //------Store ------------ //

    /** User Defined Store for Chart */
    var ChartStore = Ext.create('Ext.data.SimpleStore',{

    fields: ['auditReportNum', 'newCount','repeatedCount','deviationCount','newNameP']

    });
    Code:

    I hope i will get a soulution from Sencha....

    Thank You.

  2. #2
    Sencha User
    Join Date
    May 2012
    Location
    Turkey,İstanbul
    Posts
    25
    Answers
    2
    Vote Rating
    0
    hasimseo is on a distinguished road

      0  

    Default


    hi
    if you want to just show the value , open the tips tag . the below will code work.
    and use console.log() instead of alert to show valls
    Code:
     tips: {
    trackMouse: true,
    width: 140,
    height: 100,
    renderer: function(storeItem, item) {
    this.setTitle('New '+storeItem.get('newCount'));
    }
    }

  3. #3
    Sencha User
    Join Date
    May 2012
    Location
    Turkey,İstanbul
    Posts
    25
    Answers
    2
    Vote Rating
    0
    hasimseo is on a distinguished road

      0  

    Default


    or you can use like this ,
    that will be better

    tips: {
    trackMouse: true,
    width: 140,
    height: 100,
    renderer: function(storeItem, item) {
    var myVal=item.value;
    myVal=Ext.util.Format.number(myVal, '0,0')

    this.setTitle(myVal);
    }
    }

  4. #4
    Sencha User kantha.exe's Avatar
    Join Date
    May 2012
    Location
    India, Banglore
    Posts
    24
    Vote Rating
    -1
    kantha.exe is an unknown quantity at this point

      0  

    Default


    is it possible to put this in listener....?

    listeners: {
    trackMouse: true,
    'itemmouseup': function(storeItem, item) {
    var myVal=item.value;
    alert(myVal);
    myVal=Ext.util.Format.number(myVal, '0,0')


    alert(myVal);

    }
    }

    but in alert i am getting blank.......
    ok i will try now....
    Last edited by kantha.exe; 13 Jun 2012 at 2:17 AM. Reason: added code

  5. #5
    Sencha User
    Join Date
    May 2012
    Location
    Turkey,İstanbul
    Posts
    25
    Answers
    2
    Vote Rating
    0
    hasimseo is on a distinguished road

      0  

    Default


    in tips it work properly but in listener i am not sure ...

  6. #6
    Sencha User kantha.exe's Avatar
    Join Date
    May 2012
    Location
    India, Banglore
    Posts
    24
    Vote Rating
    -1
    kantha.exe is an unknown quantity at this point

      0  

    Default Grouped Chart

    Grouped Chart


    Is there any other way for this....?

  7. #7
    Sencha User
    Join Date
    May 2012
    Location
    Turkey,İstanbul
    Posts
    25
    Answers
    2
    Vote Rating
    0
    hasimseo is on a distinguished road

      0  

    Default


    did you try it in tips with second answer?

  8. #8
    Sencha User kantha.exe's Avatar
    Join Date
    May 2012
    Location
    India, Banglore
    Posts
    24
    Vote Rating
    -1
    kantha.exe is an unknown quantity at this point

      0  

    Default Grouped Chart

    Grouped Chart


    I tried not working....

Thread Participants: 1

Tags for this Thread