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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...