Dashboards & Visualizations
Highlighted

Can we have any background image on a line chart in Splunk?

Communicator

Can we have any background image on a line chart in Splunk? Like I will have my line chart, which does its job (with a plain background image); But, I want to have a different image (not background color alone) altogether, and I want to display my line chart on top of it, instead of that plain background image.

Please suggest.

Thanks

0 Karma
Highlighted

Re: Can we have any background image on a line chart in Splunk?

SplunkTrust
SplunkTrust
0 Karma
Highlighted

Re: Can we have any background image on a line chart in Splunk?

Champion

Hi @nadlurinadluri

Try this and let me know

<dashboard>
  <label>chart background</label>
  <row>
    <panel>
      <html>
        <style>
           #test{
            background-image: url("/static/app/search/bg.jpg");
          }
         #test rect {
          fill:none;
          }

        </style>
      </html>
      <chart id="test">
        <title>Test Image background</title>
        <search>
          <query>index=_internal | timechart  count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.chart">line</option>
        <option name="charting.drilldown">none</option>
      </chart>
    </panel>
  </row>
</dashboard>

alt text

View solution in original post

Highlighted

Re: Can we have any background image on a line chart in Splunk?

Communicator

Thanks for the answer. It certainly worked.

0 Karma
Highlighted

Re: Can we have any background image on a line chart in Splunk?

Champion

Welcome 🙂

0 Karma
Highlighted

Re: Can we have any background image on a line chart in Splunk?

Explorer

Hi, I have one question, in background-image: url ("/static/app/search/bg.jpg");
which URL i am supposed to put?
path: C:\Program Files\Splunk\etc\apps\aapname\appserver\static\images
this is my path.
when i put the image in above mentioned path and use the same in xml its not reflecting....can you help me out?

0 Karma
Highlighted

Re: Can we have any background image on a line chart in Splunk?

Champion

Hi @preacher_15

I had image in appserver/static folder

0 Karma
Highlighted

Re: Can we have any background image on a line chart in Splunk?

Champion

under search app

0 Karma
Highlighted

Re: Can we have any background image on a line chart in Splunk?

Explorer

I am still not able to get it....i have a placed an image under C:\Program Files\Splunk\etc\apps\aapname\appserver\static and copied the same url in xml.....what am i missing here?
and one more thing in your case if search is the app why have you put it inside the static folder? shouldn't it be something like app\search(appname)\static\image?
I am still a novice in splunk...so please help.

0 Karma
Highlighted

Re: Can we have any background image on a line chart in Splunk?

Champion

Hi @preacher_15

Try the following

<html>
         <style>
            #test{
             background-image: url("/static/app/test/img/yoga-1805784_1280.png");
           }
          #test rect {
           fill:none;
           }

         </style>
       </html>

Here test is the app and I had created img folder under /opt/splunk/etc/apps/test/appserver/static/img/

check the url for the folder structures

http://dev.splunk.com/view/webframework-developapps/SP-CAAAEUC