Layer bars and lines in one chart, each with its own Y axis on the left or right.
import {
chart, cartesianAxes, stepAxis, autoScaleAxis, bar, line, axisLabels
} from 'chartist';
const days = ['Mon', 'Tue', 'Wed', 'Thu'];
chart('#chart', {
data: {
labels: days,
series: [
{ name: 'orders', data: [4, 6, 5, 8] },
{ name: 'growth', data: [20, 45, 38, 60] }
]
},
axes: cartesianAxes([
{ id: 'days', side: 'bottom', type: stepAxis(), ticks: days },
{ id: 'orders', side: 'left', type: autoScaleAxis() },
{ id: 'growth', side: 'right', type: autoScaleAxis() }
]),
layers: [
bar({ series: ['orders'], y: 'orders' }),
line({ series: ['growth'], y: 'growth', align: 'center' }),
axisLabels()
]
});