score:3
this is a perfect example to learn to check the documentation carefully and also to debug.
first, you don't need the element id to render highcharts to an element. as documentation says, you can do this:
element.highcharts({/* options */});
and second, have you tried to see if your widget
variable actually contains something? if you do a console.log(widget)
, you will see that the console outputs undefined, and if you do console.log($(this).data("ui-tooltip"))
you see that the console logs the document, not the widget element. this is a perfect point to check the documentation and see that the open
event receives a second ui
argument with the actual tooltip element, being it a jquery element so no need for $(ui.tooltip)
but directly access ui.tooltip
.
now with all this info you can do this:
open: function(event, ui) {
ui.tooltip.highcharts({
which comes into this: https://jsfiddle.net/yx27xf7h/5/
important: you need to destroy the highchart when the widget closes or you will end with a memory leak (insert dramatic ♪dun dun duuun♫ music here).
edit: if you want to use a container element, is better to avoid adding ids as ids must be unique in the entire webpage so you must find a way to create a unique id each time and that's adding extra code when you can avoid it. the less code for the same task, the better.
when working with containers that are created and destroyed on the fly is better to work with references and ways to gather them as references inside their parent containers, for example doing .class
or using data attributes, like this: https://jsfiddle.net/yx27xf7h/6/
Source: stackoverflow.com
Related Query
- Render Highchart with dynamic ID in jQuery tooltip
- Format tooltip in highchart map for dynamic variables, some with commas and others with percents
- how to pass datalabels along with data to show it in tooltip in highchart
- HighChart Sparkline Chart with dynamic data for the table
- dynamic highchart config in angular ui grid with angular js using pablojim's highcharts ng
- HighChart table with tooltip
- Drawind Dynamic series and points with Highchart and ajax
- Display highchart tooltip using Jquery ui dialog
- Highchart network graph with tooltip when hover on every node
- Dynamic column based highcharts feeding data with jquery and php
- Updating a Highchart from a form with a click() event in jquery
- How to create dynamic color for highchart with dynamic dates?
- Render title with dynamic html in highcharts
- I am getting same highchart in pdf using jspdf when I am downloading the pdf with dynamic ids on click
- Highchart with dynamic scale for both series
- Dynamic tooltip for Dynamic Highchart
- How to use Jquery knob like text label with highchart Jquery plugin
- Highchart line chart tooltip issues with large dataset
- plotting dynamic array data structure with highchart
- How to render Gantt Highchart from data source
- Select dynamic value with tooltip on line chart (highcharts) in angular with material slider
- pie chart in highchart with dynamic data
- display highchart with dynamic data
- Can't set tooltip and legend dynamically in Highchart with Vue.js
- Add additional data in tooltip of Highcharts with dynamic x-axis category
- Highchart tooltip with json data
- Pie Chart is not coming with dynamic data in HIghChart
- dynamic data to Jquery code in ASP .Net Visual Studio
- highchart tooltip with multiple additional data in tooltip?
- Highcharts - how to have a chart with dynamic height?
More Query from same tag
- High chart is not getting populated
- rangeSelector input and export button missalignment
- How to specify a range of data when using HighCharts with <table>?
- Changing tootip data on pie chart in highcharts
- Different border radius
- How do I access series.data anywhere in .highcharts() function?
- highchart plotline can have move animation?
- How to make drill down in stacked Column Line chart in Highchart
- Highcharts points and lines are missing
- Highcharts : use function in Serie data
- Make Highchart R the full width and height of the box in Shiny
- Adapting CSV file to HighStock
- highcharts datalabel per point with different format
- Rails Not outputting Highcharts javascript graph
- highcharts scroll through axis
- stockChart shows future date label
- HighCharts Column Chart: Data Labels on Stacks Overlap
- How to invoke an controller action in ember.js
- Displaying dynamic data using charts and graphs in ruby on rails
- How to remove tick lines from secondary y axis in highcharts heatmap graph
- How to get rangeSelector to work with HighCharts
- Highchart in long array group categories
- Highchart gantt chart no overlapping
- HighCharts: show alla y axis on tooltip
- Unable to create Highchart where i can show different - different data on clicking category and series
- Display highchart tooltip using Jquery ui dialog
- Highcharts context menu causes chart to disappear on return from print screen only on Chrome
- Incorrect JSON data format
- How to display custom data on mouseover of column chart in highchart in addition to series data?
- How do I increase the number of points in a live updating spline chart?