0👍
I think you could fix it easy yourself, by removing the quotes, since currently it is not a function, it’s only a string:
"function": "function(x) { return 2; }",
to
"function": function(x) { return 2; },
In the dataset
...
"datasets": [{
"label": "T = const",
"function": function(x) { return 2; },
"data": [],
"fill": false,
"borderColor": "rgb(75, 192, 192)",
"tension": 0.1
}]
...
- Chartjs-Only the first element of the ChartJS dataset is displayed
- Chartjs-Chart.Js – Display only specific (fixed) X axis labels
Source:stackexchange.com