<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do you specify chart colours for a JSStack chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166996#M47529</link>
    <description>&lt;P&gt;@gibba If I could give you a million splunk points for this answer, I would. I've been working on this issue for well over an hour and this is the only thing that worked for me. This is VERY unclear in the docs.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Sep 2019 04:03:50 GMT</pubDate>
    <dc:creator>stour</dc:creator>
    <dc:date>2019-09-13T04:03:50Z</dc:date>
    <item>
      <title>How do you specify chart colours for a JSStack chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166992#M47525</link>
      <description>&lt;P&gt;I have a simple column chart with fields '-','High', 'Medium', 'Low', 'None'. I am using JS stack with the following code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var ChartView = require("splunkjs/mvc/chartview");
columnchart = new ChartView({
        id: "example-chart",
        managerid: "example-search",
        type: "column",
        "charting.chart.stackMode": "stacked",
        "charting.axisLabelsX.axisVisibility": "show",
        "charting.axisLabelsX.majorLabelStyle.rotation":45,
        "height":346,
        el: $("#example-chart")
    }).render();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to specifiy colours for each field in my bar chart rather than splunk randomly selecting them. I tried using charting.fieldColors, however after doing a bit of research it appears that this function is not supported by JSStack. Does any one know of a function that does the same thing as charting.fieldColors but is supported for JSStack?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2015 10:08:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166992#M47525</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-03-02T10:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you specify chart colours for a JSStack chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166993#M47526</link>
      <description>&lt;P&gt;charting.fieldColors is supported in JS stack, maybe it's complicated use the string formatting fo JS.&lt;BR /&gt;
for example if you need to colors your fields called INFO, WARNING and ERROR, when you define the option charting.fieldColors  you need to use the formatting string for your fields with the backslash "\".&lt;/P&gt;

&lt;P&gt;Example&lt;/P&gt;

&lt;P&gt;"charting.fieldColors": "{ \"INFO\": 0x9AC23C, \"WARNING\": 0x5479AF, \"ERROR\": 0xD85E3D }",&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2015 16:40:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166993#M47526</guid>
      <dc:creator>gibba</dc:creator>
      <dc:date>2015-05-04T16:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do you specify chart colours for a JSStack chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166994#M47527</link>
      <description>&lt;P&gt;Thanks so much, I still hadn't solved this issue. I had read a few places that charting.fieldColors was not supported but it  just needed formatting a little differently. Much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2015 14:23:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166994#M47527</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2015-05-05T14:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do you specify chart colours for a JSStack chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166995#M47528</link>
      <description>&lt;P&gt;So, to put it in a more formal way - the value of "charting.fieldColors" in JavaScript is not a map (as is claimed in the docs) - it is a &lt;STRONG&gt;string which JSON will parse into a map&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;The &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/Viz/BuildandeditdashboardswithSimplifiedXML#Specify_custom_colors_for_fields_in_charts"&gt;docs&lt;/A&gt; never talk about the difference between XML and JS representation, and there are other properties which do &lt;STRONG&gt;not&lt;/STRONG&gt; need this 'stringifying' of the value - look, for example, at "charting.seriesColors", which is an array and is specified as such in JS.&lt;/P&gt;

&lt;P&gt;Just double checking...&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2015 20:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166995#M47528</guid>
      <dc:creator>arkadyz1</dc:creator>
      <dc:date>2015-07-23T20:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do you specify chart colours for a JSStack chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166996#M47529</link>
      <description>&lt;P&gt;@gibba If I could give you a million splunk points for this answer, I would. I've been working on this issue for well over an hour and this is the only thing that worked for me. This is VERY unclear in the docs.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 04:03:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-chart-colours-for-a-JSStack-chart/m-p/166996#M47529</guid>
      <dc:creator>stour</dc:creator>
      <dc:date>2019-09-13T04:03:50Z</dc:date>
    </item>
  </channel>
</rss>

