One Dataset with multiple columns/rows are all same colour
See original GitHub issueI have spotted an issue and not sure if there is a way around it.
If one dataset has multiple rows, lines, columns then the bars/lines are all coloured the same colour:
e.g.
let title = data.chartData[0].chartTitle;
let labels = data.chartData.map(a => a.title);
let values = data.chartData.map(a => a.value);
...
datasets: [{
label: title,
borderWidth: 1,
data: values
},
Is there a way around this or do I need to design my charts differently or find another solution to colour the bars? I can colour them by specifying an array of background colours.
Thanks Robin
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
How to Filter Multiple Columns by Color in Excel (2 Methods)
In this method, I will filter multiple columns by color only using the regular Filter option of excel. In the below dataset names...
Read more >How to Compare Two Columns in Excel (for matches ...
In this tutorial, I'll show you various ways to compare two columns in Excel. The techniques shown can be used to find/highlight matches...
Read more >Guidelines and examples for sorting and filtering data by color
This picture shows filtering and sorting based on color or icon on the Category, M/M Δ%, and Markup columns. Conditional formatting with cell...
Read more >Excel - Find Duplicate Rows Based on Multiple Columns
Learn how to find duplicate rows across multiple columns. This tutorial covers deleting duplicates, highlighting duplicates and highlighting ...
Read more >How to find and highlight duplicates in Excel - Ablebits
This can be a column, a row or a range of cells. ... all instances of the same item in all the columns,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Based on a workaround from this reply to another issue:
https://github.com/nagix/chartjs-plugin-colorschemes/issues/7#issuecomment-476723949
It is possible to access the underlying arrays of colours in the plugin. So you can directly apply the colours to a single dataset. For example this simple bar graph has a single dataset with each bar being coloured using the ‘Tableau10’ palette.
As the palettes are simple arrays of hex strings they can be manipulated and extended to suit your data.
I had the same problem, but I got it working after adding
case"bar":on the switch case, it’s now like this: