Dashboards & Visualizations

Why does my dashboard shows labels in column chart for X-axis but when we exported to pdf it does not?

sarfarajsayyad
New Member

Splunk dashboard shows labels in column chart for X-axis but when we exported to pdf it doesn't. PFA screenshot

Dashboard image
alt text

After exporting to PDF
alt text

0 Karma

aaraneta_splunk
Splunk Employee
Splunk Employee

@sarfarajsayyad - Did the answer provided by bsriramineni help provide a working solution to your question? If yes, please don't forget to resolve this post by clicking "Accept". If no, please leave a comment with more feedback. Thanks!

0 Karma

bsriramineni_sp
Splunk Employee
Splunk Employee

Root cause:

In pdfgen_chart.py we have a hard-coded value (600) for the width of chart and that is why labels are hidden in pdf.

class Chart(SvgBasedViz):
    def init(self, data, fields, props, locale, runningAsScript=False):
        SvgBasedViz.init(self, data, fields, props, width=600, height=350, genSvgScriptName="gensvg.js", runningAsScript=runningAsScript, locale=locale)

This truncates the labels if the chart width is exceeded.

Workarounds:

Go to the dashboard:

a. Export> Print> Destination> Save as PDF
Or
Use the browsers 'Print' as 'Save as PDF' option.

b. You can increase the width value from 600 to a value that suits your requirement. I suggest you to try 1000.

The pdfgen_chart.py script is in the following path "C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\ pdfgen_chart.py

Post changes restart the search head(This is where you need to change this value).

Note:
1. Increasing this value will change the visualizations of other Pdf's.
2. You need to take backup of this script in case if you are going to upgrade the splunk.
Reason: While up gradation this script will be replaced.
3. You can do the modifications at your own risk.

duyuzhuo
Explorer

excause me, is it possible to change the hard-coded value (600) by input parameter, but not increase the width value in the pdfgen_chart.py?

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...