I want to make a graph with specific y and x. I discovered that to make this kind of graph, the right type is "SCATTER" so here is my code in my service :
$chart = $this->chartBuilder->createChart(Chart::TYPE_SCATTER);
$chart->setData([
'datasets' => [
[
'backgroundColor' => 'rgb(255, 99, 132)',
'data' => [20.10],[30.20]
],
]]);
$chart->setOptions([
'scales' => [
'y' => [
'suggestedMin' => 0,
'suggestedMax' => 100,
],
'x' => [
'type' => 'linear',
'position' => 'bottom',
'suggestedMin' => 0,
'suggestedMax' => 100,
],
],
]);
return $chart;
It doesnt trigger error but dont display the curve. What is the correct syntaxe for this ? Futhermore, i would like to make like 100 curve on this graph. What should be the best way to achieve this ? thank for helping !