Splunk Dev

the event does not work in the Line component in the Splunk dashboard framework

vadychka
Observer

Hello Splunk Community,

I'm encountering a problem with the component from '@splunk/visualizations/Line' in my Splunk dashboard framework. I am trying to set up an event to be triggered when a user clicks on a point in the line chart. Despite using the 'point.click' event, it doesn't seem to work as expected.

Has anyone faced a similar issue or can anyone suggest what might be going wrong here? Any guidance or examples would be greatly appreciated.

Thanks in advance for your help!

 

Here is the relevant part of my code:

import React, { useEffect, useState} from 'react';
import Line from '@splunk/visualizations/Line';


const MemoryUtilizationLine = () => {


const handleEvent = (e)=>{
console.log(e)

}


return <div className=' m-2 pie-border-style'>


<Line


pointClick ={handleEvent}


options={{}}
dataSources={{
primary: {
requestParams: { offset: 0, count: 20 },
data: {
fields: [
{
name: '_time',
},
{
name: 'count',
type_special: 'count',
},
{
name: 'percent',
type_special: 'percent',
},
],
columns: [
[
'2018-05-02T18:10:46.000-07:00',
'2018-05-02T18:11:47.000-07:00',
'2018-05-02T18:12:48.000-07:00',
'2018-05-02T18:13:49.000-07:00',
'2018-05-02T18:15:50.000-07:00',
],
['600', '525', '295', '213', '122', '19'],
['87.966380', '50.381304', '60.023780', '121.183272', '70.250513', '90.194752'],
],
},
meta: { totalCount: 20 },
},
}}
/>
Labels (3)
0 Karma
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...