score:2
Accepted answer
i don't see anything in the api that allows you to "turn on" the tooltip for renderer
created objects. in the link you provided, they create points close to the renderer
objects, and then the mouseover
of the object passes that point.
you can follow that pattern (mapping points to the renderer
objects):
function some(renderer) {
renderer.rect(10, 10, 100, 100, 1).attr({
fill: 'red'
}).add().on('mouseover', function () {
var chart = highcharts.charts[0];
var point = chart.series[0].points[0];
chart.tooltip.refresh(point);
})
.on('mouseout', function () {
var chart = highcharts.charts[0];
chart.tooltip.hide();
});
}
see fiddle here.
or you could manipulate the tooltip even more directly:
function some(renderer) {
renderer.rect(10, 10, 100, 100, 1).attr({
fill: 'red'
}).add().on('mousemove', function(e) {
highcharts.charts[0].tooltip.move(e.pagex,e.pagey); // follow the mouse
}).on('mouseout', function(e) {
highcharts.charts[0].tooltip.hide(); // off the rect, hide it
}).on('mouseover', function(e) {
var tooltip = highcharts.charts[0].tooltip;
cleartimeout(tooltip.hidetimer); // if it was in the process of hiding, cancel
tooltip.ishidden = false; // mark it as shown
tooltip.label.attr({
text: 'hi mom!' // add a label
});
tooltip.label.attr('opacity', 1).show(); // show it
});
}
see updated fiddle here.
Source: stackoverflow.com
Related Query
- Highcharts: options setting for customized renderer
- Highcharts -- exporting, setting dataLabel options
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Tooltip Options not working for Highcharts Treemap
- Highcharts display label for pie chart using html table as data source
- Simple, Open source PHP wrapper for Highcharts library
- Create Default options for multiple highcharts
- Highcharts - Exporting options for print to match export to png
- HTML table as data source for highstock charts using highcharts
- Including source for Alchemy js breaks Highcharts js
- Using a flask variable as data source for highcharts
- Highcharts Interactivity between plots - looking for code improvements
- Setting min and max for chart in Highcharts library error
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Use Node.js as data source for highcharts
- Highcharts histogram drilldown: set options for drilldown + first and last column cut-off
- How to have common options for multiple y-axes in Highcharts
- HighCharts - Set default Axis options for my extension
- Setting the top value for a highcharts chart
- Setting rounded corners on an image using Highcharts Renderer
- HighCharts turn animation false for line chart
- set different colors for each column in highcharts
- How to make highcharts default to 0 for missing data
- What format does the highcharts js library accept for dates?
- Changing data dynamically for a series in Highcharts
- Add additional data to a Highcharts series for use in formatters
- Highcharts text labels for y-axis
- Displaying percentage inside pie item for highcharts
- Display tooltip for invisible series in Highcharts
- Highcharts percentage of total for simple bar chart
More Query from same tag
- Highcharts stacked column ommit smaller values
- Adding a string to highcharts tooltip based on a separate data series
- Highcharts gauge chart size
- Highchart: Adding flags to a line chart
- call function onclick highchart
- change the color of Highmap
- HighCharts - How can I turn off the points?
- Time display at x axis instead of date display in highstock
- Width for labels on x Axis with grouped Categories in Highcharts
- Displaying ticks on top of gauge chart
- Highcharts Treemap, drillup event
- Date data from MySQL to Highcharts
- Highcharts chart creation using d3.csv
- Highcharts bar with non-stacked percent series
- Multiple categories and series in Highcharts
- Render chart only once with multiple events : Highcharts
- in highchars can we give x axis and y axis plots together
- Highcharts JS: Gap between X-Axis labels is too thin
- How to center chart title position dynamically inside pie chart in highcharts
- highcharts, Set minimum height for stacked column chart?
- Trying to render JS in RAILS causes issues
- ReferenceError: Highcharts is not defined when using lollipop series in react
- How Can I add sections of categories in gantt highcharts?
- Column chart with categorised Y axis
- Use HTML Textbox value as a HighCharts Percentage
- highcharts - setting step on axis dynamically
- plotBands Hide and Show parameters do not work in Highcharts
- On DrillUp Set Series Name Failing
- HighCharts cannot display the loading symbol. Variable is out of scope
- How to change the layout and the alignment of the legend in the Highchart?