Erich Purpur
Erich Purpur

Reputation: 1529

Superimpose charts in highcharts

Is it possible to superimpose charts in the javascript library highcharts? The columns can be the same width, it doesn't matter. But something that looks like this? (image is screenshot from python matplotlib)

enter image description here

From what I have found in other SO threads like this and from my own experimentation, it is not clear that I can.

What I'd really like to do is just draw one chart, then draw the next one over it. It would make my life much more simple...

Upvotes: 0

Views: 27

Answers (1)

ppotaczek
ppotaczek

Reputation: 39139

You just need to use two series with disabled grouping and groupPadding:

    plotOptions: {
        series: {
            grouping: false
        }
    },
    series: [{
        data: [...],
        groupPadding: 0
    }, {
        data: [...]
    }]
});

Live demo: http://jsfiddle.net/BlackLabel/gfj16908/

API Reference:

https://api.highcharts.com/highcharts/plotOptions.column.groupPadding

https://api.highcharts.com/highcharts/plotOptions.column.grouping

Upvotes: 1

Related Questions