score:1
Accepted answer
The data isn't probably available immediately that's why it's returning a null data. However, you can set the data asynchronously using a setTimeout delay like so.
const [price, setPrice] = useState<number>(0)
options = {
...
plotOptions: {
series: {
point: {
events: {
mouseOver: function(e:any) {
price = // logic to fetch price based on mouse position
console.log(price)
setTimeout(() => { // This is where the delay comes in
setPrice(price)
}, 0)
}
}
}
}
}
}
score:0
My hunch is there is a time delay to get that data back to you. Try async/await and then set your state back on those results.
Source: stackoverflow.com
Related Query
- React useState throws error on Highcharts mouseOver
- creating a bar chart using Highcharts with React - getting an error that rendering div isn't found
- HighCharts Stock Chart error code 18
- Uncaught Error: Highcharts error #17 while creating sunburst chart using react
- Error in rendering a React highcharts x-range chart
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Highcharts Scrollbar up arrow throws error on click
- PDF having Highcharts (multiple series) chart generated using svg2pdf.js throws error
- How can I fix Highcharts error #13?
- Highcharts Error #16: charts not showing on the same page
- Getting error while using highcharts in Angular 7
- highcharts always console error ablout bubble_compiled.js?
- Highcharts error 15
- JavaScript error when using Highcharts
- Dynamically update Highcharts chart in react
- Highcharts is not defined. Error log in console
- Highcharts returning error 14
- jquery calling highcharts generating error 17
- highcharts organization chart is throwing error when loading module
- Initializing Highstock.js throws a jQuery error in getComputedStyle
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- HighCharts error #18: Requested Axis Does not exist
- Highcharts - Global configuration with common code and unique data & Headings
- Highcharts error #13: www.highcharts.com/errors/13 how to solve this error
- Getting "Highcharts error #17" when creating histogram (using Highcharts with Angular 6)
- Issues using highcharts node export server from ClojureScript - "0x03 error when performing chart generation"
- Highcharts & tooltip error
- Highcharts error 13, but rendering Div exists
- Gauge Series of Highcharts with React not the Solid Gauge but Gauge Series
- Highcharts - Show tooltip on points click instead mouseover
More Query from same tag
- Highcharts error 19 issue when adjusting container width that chart displays in
- Highcharts Y-axis title text length is more than chart's height
- Connected charts in highcharts
- Highcharts - Xrange chart events issue
- To add zAxis dynamically, but doesn't work... Highcharts
- Column behind column highchart
- Highcharts - Export button options offset using a little div
- Highcharts Timeline xAxis
- HighCharts: Annotation on X axis?
- fail to make xAxis on Highstock chart to go before
- Highcharts - How to programmatically toggle legend items and determine which items are selected
- Highcharts conditional data labels
- highcharts line for one point serie
- Send variables from Symfony2 PHP file to js file
- Highcharts align multiple piecharts
- Highstocks line chart issue after HS upgrade
- How to do highcharts in coldFusion?
- Highcharts: How to remove tiny space between stacked bars/columns
- R highcharter() global thousand separator?
- Highcharts do not hold all the values of stacked columns chart with data time axes
- highcharts error 14 when passing time
- Setting tick interval dynamically in highstock chart
- Highcharts Display Issue
- HighCharts Heatmap: Plotting error with >= 1024 samples
- Duplicate, Off-Screen Chart
- Click event in treemap in highcharts
- Highcharts gauge fill to 100% of container
- Highcharts: Solidgauge Shadows
- How to implement date selector to HighChart StockChart in reactjs (without jQuery)
- Remove HighCharts border for Android