stable

Clone or download

Read-only

request #21786 Legend color is not generated when graph has many legend

How to reproduce: Have a graph on tracker over a field who has more than 10 different values and where no color is definedby field configuration => some data in chart will be black, an error is thrown Explainations: D3 scale provides color[0], and we used to access them by their index. We reached a limit, the more possible values is up to 12, I could change the scheme to use `schemePaired` but it will only push the limit 2 elements ahead. If I use the `schemeSpectral` for example, I will need to use random values, and everything will change everytime. I kept the `schemeTableau10` and if we have more legend than what can be provided by D3, then I'll use random html color. That means, in most of the cases, the graph color will be fixed, and for huge graph, some color will change at every page update https: //www.npmjs.com/package/d3-scale-chromatic Change-Id: I81719b2bdf0b7053b47a541d29de8ce0fee56409

Modified Files

Name
M plugins/graphontrackersv5/scripts/src/graphs-bar.js +3 −1 Go to diff View file
M plugins/graphontrackersv5/scripts/src/graphs-groupedbar.js +4 −2 Go to diff View file
M plugins/graphontrackersv5/scripts/src/graphs-pie.js +3 −1 Go to diff View file