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!

Announcing the Expansion of the Splunk Academic Alliance Program

The Splunk Community is more than just an online forum — it’s a network of passionate users, administrators, ...

Learn Splunk Insider Insights, Do More With Gen AI, & Find 20+ New Use Cases You Can ...

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

Buttercup Games: Further Dashboarding Techniques (Part 7)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...