I create a piechart that has these results in tabular form.
Type count
1 Pass 0
2 Failed 14
3 Uncovered 0
It has 3 sections, Pass, Failed, Uncovered.
In the above example, Failed = 100% of the piechart.
I would like to colour it so that Pass is green, Failed is pink and Uncovered is Red
I have tried two different code
<module name="HiddenChartFormatter">
<param name="chart">pie</param>
<param name="charting.fieldColors">{"Pass":0x009933,"Failed":0xff6ff2,"Uncovered":0xe00707}</param>
This does not work with JSChart.
<param name="charting.seriesColors">[0x009933, 0xff6ff2, 0xe00707]</param>
Using seriesColors does not tie a colour to a value, so in the above piechart, Failed would be green as it is the only field that shows up in the piechart.
Am I doing something wrong with fieldColors?
I currently meet the same problem coloring JSChart but it is not working.
Solution 1:
Solution 2:
They both do not work, not all the colors are mapped correctly.
I see several posts here but not really a final solution.
Does anyone know a solution.
I had pretty much the same issue and ended up by configuring the legend labels manually in the HiddenChartFormatter:
<param name="charting.legend.labels">[Info, Low, Medium, High, Critical, Fatal]</param>
<param name="charting.seriesColors">[0x999999,0x5378AD,0x98BF3B,0xF0BE1B,0xFF8800,0xD25B3B]</param>
HTH.
Simon
hey cmak,
did you solve this problem? if so can you please share your work around?
Thanks
The field is created in the search. It is just when the value is ', the piechart does not show it, and it does not count as a field although it is present.
This is what the table looks like :
Type count
1 Pass 0
2 Failed 0
3 Uncovered 1
The piechart just will show 100% uncovered
How about creating the field anyway in your search, even if there's no content, e.g. with fillnull() ? --> http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Fillnull
The problem with my query is that Of the three fields I have (Pass, Failed, Uncovered), they may not all be present. When pass is not present, then failed label will receive the first color.
The legend.labels does not change this fact.