You found a bug! We've classified it as EXTJS-8531 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    175
    Vote Rating
    2
    renganathan is on a distinguished road

      0  

    Default Set maximum bar width in ExtJS 4 column chart?

    Set maximum bar width in ExtJS 4 column chart?


    Hi All,


    I have a 250px wide column chart, it looks great when there are 10+ items in the series, but when there's only 2-3, the bars are drawn really wide, which looks somewhat odd.

    _____
    | |
    | |
    -----|-----
    I can set the width in the series config:

    {
    style: { width: 25 }
    }
    This works, but the thinner bars are still left-aligned with their previous position, so they don't match up with the axis tick and label.
    Like so:

    _
    | |
    | |
    -----|-----
    I don't want to change the axis spacing, I want to end up with widely-spaced, 25px bars (that are correctly centered on the axis tick):

    _
    | |
    | |
    -----|-----
    Any ideas?
    Thanks,

    RENGANATHAN M G

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,910
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    What version of ExtJS are you using? I recall reporting this issue and it was corrected.

    Regards,
    Scott.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Location
    Bangalore, India
    Posts
    175
    Vote Rating
    2
    renganathan is on a distinguished road

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    What version of ExtJS are you using? I recall reporting this issue and it was corrected.

    Regards,
    Scott.
    Extjs4.1
    Thanks,

    RENGANATHAN M G

  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,910
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    See if this is working as expected:

    Code:
    Ext.require('Ext.chart.*');
     
    Ext.onReady(function() {
     
     var store = Ext.create('Ext.data.JsonStore', {
        fields: ['name', 'data1'],
        data: [
        { 'name': 'metric one',   'data1': 25},
        { 'name': 'metric two',   'data1': 14}
        ]
    });
     
    var mychart = Ext.create('Ext.chart.Chart', {
        renderTo: Ext.getBody(),
        width: 300,
        height: 300,
        store: store,
    
        legend: true,
        axes: [
            {
                type: 'Numeric',
                position: 'left',
                fields:  'data1',
                title: 'Sample Values',
    			minimum:0,
            },
            {
                type: 'Category',
                position: 'bottom',
                fields: 'name',
                title: 'Sample Metrics',
     
            }
        ],
        series: [{
            type: 'column',
            axis: 'left',
            xField: 'name',
            yField: 'data1',
    		style:{
    			width:'30',
    		},
    		 label: {
                field:'data1',
                renderer: Ext.util.Format.numberRenderer('0'),
            },
     
        }]
    });
    });
    f210589.png

    Regards,
    Scott.

  5. #5
    Sencha User
    Join Date
    Jul 2011
    Posts
    15
    Vote Rating
    0
    ajeetsingh85 is on a distinguished road

      0  

    Default Not aligned properly

    Not aligned properly


    Thanks Scott for your valuable help.....the width is reduced but the bar is aligned in left most that is not matching with X-Axis lables.. see screenshotdashboard_chart.png
    Any help will be appreciated

  6. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,910
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Can you provide a small working example, or modify my example to display your problem?

    Scott.

  7. #7
    Sencha User
    Join Date
    Jul 2011
    Posts
    15
    Vote Rating
    0
    ajeetsingh85 is on a distinguished road

      0  

    Default


    I executed your code in .php file......
    It is giving below greaph....graph_error_Scott.png

  8. #8
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,910
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    @ajeetsingh85 . what version exact version of ExtJS4, as this was corrected in a previous version.

    Scott.

  9. #9
    Sencha User
    Join Date
    Jul 2011
    Posts
    15
    Vote Rating
    0
    ajeetsingh85 is on a distinguished road

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    @ajeetsingh85 . what version exact version of ExtJS4, as this was corrected in a previous version.

    Scott.
    I am using Ext JS 4.1

  10. #10
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,910
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    I am using Ext JS 4.1
    But there are numerous releases of 4.1. Have you tried 4.1.1 RC2?
    http://www.sencha.com/forum/showthre...-Now-Available

    Scott.

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..."