- Issue created by @visway12
- 🇮🇳India visway12
Added colorAxis js in the charts_highchart library file
Piechart-color-axis.patch →
This patch adds support for the colorAxis options for the Pie Charts chart type.
With this patch the colorAxis option can be used to set a custom range of colours for the Pie chart display. For example:
const contents = new Drupal.Charts.Contents();
if (drupalSettings.hasOwnProperty('charts') && drupalSettings.charts.highcharts.global_options) {
Highcharts.setOptions(drupalSettings.charts.highcharts.global_options);
}
once('charts-highchart', '.charts-highchart', context).forEach(function (element) {
const id = element.id;
let config = contents.getData(id);
config.legend.enabled = false;
delete config.colors;
config.colorAxis = {};
config.colorAxis.minColor = "#e3cccf";
config.colorAxis.maxColor = "#772310";
if (!config) {
return;
}
config.chart.renderTo = id;
new Highcharts.Chart(config);
if (element.nextElementSibling && element.nextElementSibling.hasAttribute('data-charts-debug-container')) {
element.nextElementSibling.querySelector('code').innerText = JSON.stringify(config, null, ' ');
}
});
Which result will be like this(Color is different):
Active
5.0
Highcharts integration
Added colorAxis js in the charts_highchart library file
Piechart-color-axis.patch →