0👍
✅
What you have indicated you wanted to change is the tooltip. It can be configured in many ways, as you can see from the docs.
But first you have to send the times
from python to the script. One way to do that is to just declare a new variable, at the beginning of your script, following your approach for the other two components (I suppose this is not user data and you trust it):
const allTimes = [
{% for result in results_lc %}
'{{ result.time }}',
{% endfor %}];
Then you continue the script as before, with var ctx = ...
,
but add in the chart configuration under plugins
the configuration for the tooltip with a custom label
callback:
plugins: {
legend: {
display: false,
},
tooltip: {
callbacks: {
label: context => "swimtime: " + allTimes[context.dataIndex]
}
}
}
That should do it.
0👍
In new Chart you have a prop called datasets.label: FINA points. Change this to respective label that you want.
Source:stackexchange.com