Alexey Kutuzov
Alexey Kutuzov

Reputation: 689

Extjs multicolumn chart

I want to create extjs 4 column chart with many columns for each 'x value'. I define 2 columns in 'series':

series: [
    {
        type: 'column',
        axis: 'left',
        xField: 'key',
        yField: ['val1']
    },
    {
        type: 'column',
        axis: 'left',
        xField: 'key',
        yField: ['val2'],
    }
]

It create second column on first column (p1 in screenshot), but i want to see second column near first (p2 in screenshot). What parameter i should add to get excepted chart?

Upvotes: 1

Views: 2720

Answers (1)

Abdel Raoof Olakara
Abdel Raoof Olakara

Reputation: 19353

Here is what you can do:

series: [{
    type: 'column',
    xField: 'key',
    yField: ['val1','val2']                                                         
}]

When you provide two or more values to the same series, you get what you are expecting. This type is called grouped bar/column series.

Upvotes: 3

Related Questions