Results 1 to 4 of 4

Thread: How to change column width in extjs columns chart

  1. #1
    Sencha User
    Join Date
    Mar 2014
    Posts
    2

    Default Answered: How to change column width in extjs columns chart

    Ext.define('Browser', {
    extend: 'Ext.data.Model',
    fields: [{
    name: 'rate',
    type: 'float'
    },{
    name: 'name',
    type: 'string'
    }]
    });

    var store = Ext.create('Ext.data.Store', {
    model: 'Browser',
    data: [
    { 'name': 'IE', 'rate':4},
    { 'name': 'Firefox', 'rate':5},
    { 'name': 'Google Chrom', 'rate':1},
    { 'name': 'IE', 'rate':27.72},
    { 'name': 'Firefox', 'rate':19.76}
    ]
    });

    Ext.create('Ext.panel.Panel', {
    renderTo: Ext.getBody(),
    title: '???????????',
    width: 600,
    height: 300,
    layout: 'fit',
    items:[{
    xtype: 'chart',
    store: store,
    axes: [{
    title: '???? ????????',
    type: 'Numeric',
    position: 'left',
    fields: ['rate'],
    minorTickSteps: 5 // ???? ??????? ?? ??? y
    },{
    title: '???????',
    type: 'Category',
    position: 'bottom',
    fields: ['rate']
    }],

    series: [{
    type: 'column',
    axis: 'bottom',
    xField: 'name',
    yField: 'rate',
    gutter: 50, // ?????????? ????? ??????????, ? % ?? ?????? ???????
    style:{
    stroke: '#0000d2', // ???? ????? ???????
    'stroke-width': 1, // ??????? ????? ???????
    width:'4', // ?????? ??????? ???????????
    fill: '#FF0000' // ???? ??????? ???????
    },
    label: {
    field:'rate',
    renderer: Ext.util.Format.numberRenderer('0')
    }
    }]
    }]
    });
    image002.jpg

  2. What version of Ext4 are you using? Older versions suffered from this bug.

    You can test your code on each of our versions using our fiddle:
    https://fiddle.sencha.com/#home

    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    On the series, set the width like this:

    Code:
    style:{
        width:'30',
    },

  4. #3
    Sencha User
    Join Date
    Mar 2014
    Posts
    2

    Default

    Quote Originally Posted by scottmartin View Post
    On the series, set the width like this:

    Code:
    style:{
        width:'30',
    },
    Thank you Scott,

    I did it, but a frame on the chart - remained!

    Code:
    style:{ 
          width:'4',           // ?????? ??????? ???????????
          fill: '#FF0000'   // ???? ??????? ???????
         },
    image003.jpg

    I need to build a histogram of the width of the columns 2 and 3 pixels without distance between columns. To set the distance using the property gutter. And how to remove the frame around the column can not find.

    B.r. Alex

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,409
    Answers
    716

    Default

    What version of Ext4 are you using? Older versions suffered from this bug.

    You can test your code on each of our versions using our fiddle:
    https://fiddle.sencha.com/#home

    Scott.

Tags for this Thread

Posting Permissions

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