1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Vote Rating
    0
    skylinezpromise is on a distinguished road

      0  

    Default change Extjs chart style on the fly

    change Extjs chart style on the fly


    Hi, I have a grouped bar chart, I want the user to have the ability to change bars width dynamically, so I have made 3 buttons to allow the user to choose "Small" "Medium" or "Large" bar width.
    How can I access chart's bars width and affect a value to it ?
    I've tried this, but it's not working.

    Code:
     // the handler of the "small" button click
             var chart = Ext.widget('drawchart');
             Ext.apply(chart.series.style, {
                                    width: 2
                                });
             chart.redraw();
    Please help me, I'm going crazy over this.

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    4,800
    Vote Rating
    167
    slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold slemmon is a splendid one to behold

      0  

    Default


    The only way I can think to do this is not by setting the bar width, but rather the gutter percentage between the bars.
    http://docs.sencha.com/extjs/4.2.0/#...Bar-cfg-gutter

    Code:
    chart.series.first().gutter = 50;
    chart.redraw();

Thread Participants: 1

Tags for this Thread