I have the following code:
const historicDate = ['<span>${day}<br/>${time}</span>', /* many more... */]
<Line
options={{
responsive: true,
plugins: {
legend: {
position: 'top' as const
}
}
}}
data={{
labels: historicDate,
datasets: [
{
label: 'Temperature',
data: [30, 31, /* many more... */],
borderColor: 'rgb(255, 99, 132)',
backgroundColor: 'rgba(255, 99, 132, 0.5)'
}
]
}}
/>
What I want to achieve is to display the historicDate
array elements as html, but it is being displayed as a string.
Btw, I'm using:
- chart.js: v4.1.1
- react-chartjs-2: v5.1.0
${time} ` Is that you want? – MOLLY Dec 23 '22 at 01:54