<?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 to add % symbol with data labels in charts? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361607#M106809</link>
    <description>&lt;P&gt;thanks @niketnilay i will try this and let you know if it works! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Apr 2018 01:00:39 GMT</pubDate>
    <dc:creator>mrccasi</dc:creator>
    <dc:date>2018-04-13T01:00:39Z</dc:date>
    <item>
      <title>How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361595#M106797</link>
      <description>&lt;P&gt;I want to add % symbol with both the y-axis legend and data labels&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4326i6D1BA656E251FA50/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 10:56:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361595#M106797</guid>
      <dc:creator>ny34940</dc:creator>
      <dc:date>2018-02-08T10:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361596#M106798</link>
      <description>&lt;P&gt;Following is run anywhere dashboard Simple XML code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="highchart_data_label_percent.js"&amp;gt;
   &amp;lt;label&amp;gt;Highchart Data Label Suffix Percent&amp;lt;/label&amp;gt;
   &amp;lt;row&amp;gt;
     &amp;lt;panel&amp;gt;
       &amp;lt;title&amp;gt;Splunk Component Error % by Hour&amp;lt;/title&amp;gt;
       &amp;lt;html&amp;gt;
         &amp;lt;style&amp;gt;
           #myHighChart g.highcharts-data-label text{
             fill: white !important;
           }
       &amp;lt;/style&amp;gt;
       &amp;lt;/html&amp;gt;
       &amp;lt;chart id="myHighChart"&amp;gt;
         &amp;lt;search&amp;gt;
           &amp;lt;query&amp;gt;index=_internal | chart count by log_level&amp;lt;/query&amp;gt;
           &amp;lt;earliest&amp;gt;-1d@d&amp;lt;/earliest&amp;gt;
           &amp;lt;latest&amp;gt;@d&amp;lt;/latest&amp;gt;
           &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
         &amp;lt;/search&amp;gt;
         &amp;lt;option name="height"&amp;gt;540&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.overflowMode"&amp;gt;ellipsisNone&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;0&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisLabelsY.majorUnit"&amp;gt;20&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisX.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisY.maximumNumber"&amp;gt;100&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisY.minimumNumber"&amp;gt;0&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisY2.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisY2.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.axisY2.scale"&amp;gt;inherit&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart.bubbleMaximumSize"&amp;gt;50&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart.bubbleMinimumSize"&amp;gt;10&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart.bubbleSizeBy"&amp;gt;area&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart.showDataLabels"&amp;gt;all&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart.stackMode"&amp;gt;stacked&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.layout.splitSeries.allowIndependentYRanges"&amp;gt;0&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.legend.mode"&amp;gt;standard&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.legend.placement"&amp;gt;right&amp;lt;/option&amp;gt;
         &amp;lt;option name="charting.lineWidth"&amp;gt;2&amp;lt;/option&amp;gt;
         &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
         &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
         &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
         &amp;lt;option name="trellis.size"&amp;gt;medium&amp;lt;/option&amp;gt;
       &amp;lt;/chart&amp;gt;
     &amp;lt;/panel&amp;gt;
   &amp;lt;/row&amp;gt;
 &amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the JavaScript Code &lt;CODE&gt;highchart_data_label_percent.js&lt;/CODE&gt; to be included: put this in &lt;CODE&gt;/etc/apps/your_app/appserver/static&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     "jquery",
     "splunkjs/mvc",
     "splunkjs/mvc/simplexml/ready!"
 ], function($,mvc){

     mvc.Components.get("myHighChart").getVisualization(function(chartView) {
         chartView.on("rendered", function() {
                 $("g.highcharts-data-label text:not(:contains(%)) tspan").after(" %");
                 $("g.highcharts-yaxis-labels text:not(:contains(%)) tspan").after(" %");
         });
     });
 });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then &lt;CODE&gt;debug/refresh&lt;/CODE&gt; OR "_bump"&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4325i836B3C56999B1502/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Let me know if this helps! &lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 11:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361596#M106798</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-02-08T11:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361597#M106799</link>
      <description>&lt;P&gt;have a look at answer&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/598632/add-percent-sign-on-a-stacked-column-chart-data-la.html"&gt;https://answers.splunk.com/answers/598632/add-percent-sign-on-a-stacked-column-chart-data-la.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 12:28:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361597#M106799</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-08T12:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361598#M106800</link>
      <description>&lt;P&gt;Thanks! I wanted to do this using charting options but looks like I have to use JavaScript.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 12:41:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361598#M106800</guid>
      <dc:creator>ny34940</dc:creator>
      <dc:date>2018-02-08T12:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361599#M106801</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 12:41:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361599#M106801</guid>
      <dc:creator>ny34940</dc:creator>
      <dc:date>2018-02-08T12:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361600#M106802</link>
      <description>&lt;P&gt;hi mayurr98 -&lt;/P&gt;

&lt;P&gt;i tried following your instructions but it does not work on my bar chart. i have also added the js file on the static folder and did the _bump and debug/refresh. is there any thing i am missing? i also like to put percent sign on the label of x axis for the bar chart.&lt;/P&gt;

&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 04:13:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361600#M106802</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2018-04-12T04:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361601#M106803</link>
      <description>&lt;P&gt;hey @mrccasi&lt;/P&gt;

&lt;P&gt;This is specifically for column chart. I do not know if this will work for bar chart. &lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 05:38:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361601#M106803</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-12T05:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361602#M106804</link>
      <description>&lt;P&gt;hi mayurr98 -&lt;/P&gt;

&lt;P&gt;thanks for the reply. soeey my mistake, i was using bar chart as well. but it does not work.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 05:52:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361602#M106804</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2018-04-12T05:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361603#M106805</link>
      <description>&lt;P&gt;@mrccasi have you posted a question for showing percent in bar chart?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 05:56:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361603#M106805</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-12T05:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361604#M106806</link>
      <description>&lt;P&gt;hi mayurr98 -&lt;/P&gt;

&lt;P&gt;sorry i mean column chart not bar chart.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 05:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361604#M106806</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2018-04-12T05:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361605#M106807</link>
      <description>&lt;P&gt;hi niketnilay -&lt;/P&gt;

&lt;P&gt;uhmm no. my problem is the same as this for the column chart so i thought i will just add comments and not create a new question.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Apr 2018 06:01:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361605#M106807</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2018-04-12T06:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361606#M106808</link>
      <description>&lt;P&gt;@mrccasi, the code should work on Column Chart. For Bar Chart the x-axis is y-axis with percent where the code does not work.&lt;/P&gt;

&lt;P&gt;So, if you are using Column chart with chart &lt;CODE&gt;id="myHighChart"&lt;/CODE&gt;, then the code should work.&lt;/P&gt;

&lt;P&gt;In your JS you can make the CSS override to be more specific to the myHighChart using the ID in the selector (which was missing in original code)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  mvc.Components.get("myHighChart").getVisualization(function(chartView) {
      chartView.on("rendered", function() {
              $("#myHighChart g.highcharts-data-label text:not(:contains(%)) tspan").after(" %");
              $("#myHighChart g.highcharts-yaxis-labels text:not(:contains(%)) tspan").after(" %");
      });
  });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Apr 2018 16:34:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361606#M106808</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-12T16:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361607#M106809</link>
      <description>&lt;P&gt;thanks @niketnilay i will try this and let you know if it works! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 01:00:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361607#M106809</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2018-04-13T01:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add % symbol with data labels in charts?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361608#M106810</link>
      <description>&lt;P&gt;Thanks for this answer but could you please help me to put the percentage sign in the fields in the overlay chart only /??&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 08:30:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-symbol-with-data-labels-in-charts/m-p/361608#M106810</guid>
      <dc:creator>dinaabdelhakam</dc:creator>
      <dc:date>2018-12-09T08:30:44Z</dc:date>
    </item>
  </channel>
</rss>

