Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Highcharts has the ability to use an array of object as values for data points.
Paraphrased from the Highcharts documentation. (eg https://api.highcharts.com/highcharts/series.line.data)
series.*.data
An array of data points for the series.
1. An array of numerical values.
2. An array of objects with named values.
This allows for some per-point settings, such as color, to be specified.
Please add the capability to use an "array of objects" as the data sequence.
Comment | File | Size | Author |
---|---|---|---|
#2 | Screen Shot 2018-08-15 at 09.40.36.png | 13.22 KB | John Cook |
#2 | Screen Shot 2018-08-15 at 09.40.11.png | 9.28 KB | John Cook |
#2 | 2992740-2.patch | 1.02 KB | John Cook |
Comments
Comment #2
John Cook CreditAttribution: John Cook at Creode commentedI've created a patch to allow the data points to be "objects".
By changing the first data set in the example module to:
'data' => [['y' => 250, 'color' => '#cc00cc'], 350, 400, 200],
It allows the following graphs (notice the magenta – #cc00cc – point and slice):
Comment #3
John Cook CreditAttribution: John Cook at Creode commentedComment #5
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedComment #6
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commented