0👍
maybe you can try like this
//setup
const data = {
labels: <?= json_encode($datesForChart) ?>,
datasets: [{
label: <?= json_encode($viewData['selectedCurrency1']) ?>,
data: <?= json_encode($ratesForChartCurrency1) ?>,
borderWidth: 1
},
{
label: <?= json_encode($viewData['selectedCurrency2']) ?>,
data: <?= json_encode($ratesForChartCurrency2) ?>,
borderWidth: 1
}]
};
// config
const config = {
type: 'line',
data,
options: {
scales: {
y: {
beginAtZero: false
}
}
}
};
- Chartjs-Can i use crosshairs with OHLC/candlestick charts using ChartJS
- Chartjs-Where can I find breaking changes in chart.js in early versions?
Source:stackexchange.com