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 },
},
}}
/>
... View more