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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

John Cook created an issue. See original summary.

John Cook’s picture

I'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):

John Cook’s picture

Status: Active » Needs review

andileco’s picture

Status: Needs review » Fixed
andileco’s picture

Status: Fixed » Closed (fixed)