Search code examples
dimple.js

Multiseries Bar Chart dimple js


I'm trying to draw multiple series bar chart using dimple.js; My requirement is quite simple that all series should have individual bars (not stacked); scales for two series not same, One is currency value, other is count.

var v = {
    [supplier: 'x', invoices: 10, invValue: 1000],
    [supplier: 'y', invoices: 5, invValue: 500],
    [supplier: 'z', invoices: 20, invValue: 2000],
}

I've already googled and also traversed stackoverflow where expets suggest to do data hack like this

var v = {
    [supplier: 'x', kind: 'invoices', value: 10],
    [supplier: 'x', kind: 'invValue', value: 1000],
    [supplier: 'y', kind: 'invoices', value: 5],
    [supplier: 'y', kind: 'invValue', value: 500],
    [supplier: 'z', kind: 'invoices', value: 20],
    [supplier: 'z', kind: 'invValue', value: 2000],
}

as the scale changes I don't go with this method. what'll be the possible alternate solutions.


Solution

  • And at last I understand that there's no way to implement chart with dimple.js, but as a alternative, it's easy to go with multiple line charts, also possible to do draw first series as dimple.bar, other series dimple.line chart