src/delivery/web/renderers/charting/charts/DataPointChart.php 1 location
|
@@ 20-29 (lines=10) @@
|
17 |
|
$this->dataPoints = $dataPoints; |
18 |
|
} |
19 |
|
|
20 |
|
public function data() { |
21 |
|
return array_map(function (DataPoint $point) { |
22 |
|
return array_merge( |
23 |
|
[ |
24 |
|
"label" => $point->getLabel(), |
25 |
|
"value" => $point->getValue() |
26 |
|
], |
27 |
|
$this->makePalette($point->getColor() ?: $this->provideColor())); |
28 |
|
}, $this->getDataPoints()); |
29 |
|
} |
30 |
|
|
31 |
|
/** |
32 |
|
* @return DataPoint[] |
src/delivery/web/renderers/charting/charts/DataSetChart.php 1 location
|
@@ 33-40 (lines=8) @@
|
30 |
|
} |
31 |
|
return [ |
32 |
|
"labels" => $this->makeLabels(), |
33 |
|
"datasets" => array_map(function (DataSet $set) { |
34 |
|
return array_merge( |
35 |
|
[ |
36 |
|
"label" => $set->getLabel(), |
37 |
|
"data" => $set->getValues() |
38 |
|
], |
39 |
|
$this->makePalette($set->getColor() ?: $this->provideColor())); |
40 |
|
}, $dataSets) |
41 |
|
]; |
42 |
|
} |
43 |
|
|