I noticed that the class names assigned to element of table within a quick value chart are not unique.
Graylog Version 2.4.6
How to reproduce.
Create a quick value chart from some data field in the search menu.
If you examine the html , you can see that all table elements are assigned a non uniqiue class=“datatable-badge” as shown below.
Whereas if you look at the pie or stacked charts they have multiple classes assigned to them for example
class=“pie-slice _0” to “pie-slice _9” for each data segment see below.
The goal I wanted to achieve was to change the default system colors used by dc.js and d3.js within graylog.
At first, I looked in D3Utils.js in graylog2-web-interface/src/util/D3Util.js where it sets the colors palette, so I changed the palette and build graylog but still had the original colours within the charts. I also checked the source for any other hard coded references but could not find anything obvious.
So I decided to try to modify the css in the main css file but came across the problem described above. The code for producing the tags is in QuickValue.Vizualization.jsx as shown below:-
So I have two questions:-
- Why does modifying the D3Utils.js file not change the color palette as it is imported in QuickVizualizations.jsx and other places ?
- How would you modify the source code for Quick Vizualiztions added an extra classs in the form of class=“datatable-badge _0” to class=“datatable-badge _9” in the same way as the pie chart and stacked charts.
I will look again at the pie chart code to see if I can see where this is done or is this a bug / flaw?
Any help appreciated