All Apps and Add-ons

Click on axis labels in bar chart javascript

aelliott
Motivator

Is there a way to integrate a javascript click function for the tspan elements in the svg that is generated by Splunk for Axis Labels. I want to tie a .on('click', function(){}); via javascript to the Axis Labels on the Bar Chart to drill the dashboard down to that value.
I am using Splunk Web Framework

0 Karma
1 Solution

magnew_splunk
Splunk Employee
Splunk Employee

Hi aelliott,

This feature isn't currently supported in the Web Framework (or with Splunk controls generally). You could potentially use JQuery to reach into the wrapped HighCharts control in the DOM, but that will get messy quick. And fragile.

One thing you could try is using the Web Framework's D3Chart control which has a bar chart that is much more configurable. It's more complex to use, but you should be able to attach handlers to whatever you want.

View solution in original post

0 Karma

magnew_splunk
Splunk Employee
Splunk Employee

Hi aelliott,

This feature isn't currently supported in the Web Framework (or with Splunk controls generally). You could potentially use JQuery to reach into the wrapped HighCharts control in the DOM, but that will get messy quick. And fragile.

One thing you could try is using the Web Framework's D3Chart control which has a bar chart that is much more configurable. It's more complex to use, but you should be able to attach handlers to whatever you want.

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 at Splunk .conf24 ...

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 ...