display plot legend in hovertool in Bokeh- I get "???" when I use the "$name" keyword in tooltips - tooltip

Is there an easy way to display the legend associated with a line plot in hovertool. I tried
TOOLTIPS = [
("index", "$index"),
("(x,y)", "($x, $y)"),
("desc", '$name'),
]
but hovetool shows "desc:???" instead of the name of the plot

Related

Highchart Scatter plot with 2 series, tooltip refresh command giving error

I have 1 chart with 2 scatterplot series like so
The series have same data points, basically I am drawing 2-2D plots instead of 1-3D plot..
Series 1 has the legend while on 2 its disabled. When I hover my cursor over the legend I want the tooltip to show up in both the chart, so a user can correlate legend to points on scatter plots.
$('.highcharts-legend text, .highcharts-legend span').each(function (index, element) {
$(element).hover(function () {
chart.tooltip.refresh([chart.series[index].data[0], chart.series[index+data.length].data[0]]);
}, function () {
chart.tooltip.hide();
})
});
I use above code to create desired effect, but tooltip is not appearing at the right place. maybe its a limitation from highchart. It throws the following JS error
Could someone please suggest me a workaround?
If you could make the chart.tooltip.refresh to function properly that would be the best. Other wise I am willing to make a compromise with at-least having the points in both series in hovered state and 1 of them showing the tooltip.
here is a fiddle to see the problem in action https://jsfiddle.net/9eoyg283/1/ , Hover over the legend items and you would get JS error in the console.
I can create the desired effect if I create 2 charts instead of using 2 series, but then that complicates other things which are not desirable. So this solution is off
Thanks in advance

Highcharts Get legend "icon" in tooltip

Is there any way to get the legend "icon" in tooltip? I need to show the legend "icon" in the tooltip so i can identify what series I'm referring to.
I'll try to explain it better.
When you create a chart, in the legend, next to the name of the series, there is a "mini" line, that represent the line of the series, the color, and the style.
That what I need to show in the tooltip.
I'm not referring to the dot marker but the small lines that appears in the legend.
Is that possible?
Edit:
I'm using the formatter that the tooltip api provides. There I have a reference of the point that I'm hovering on, and all the data associated to that point.
I can get the value, the chart, the series, the series to which it belongs, que point marker, almost everything.
But I can't figure how to get the little coloured line that appears next to every series name in the legend.
I guess is as simple as get one of the values that appears in the point data, but I don't know what I should look for, there are a lot of properties.
I found a solution.
You can look for the point.series.legendLine.
There you have all the info required for the legend svg, even you can get the outerHTML and paste directly to show the legend icon.

Is it possible with highcharts to add specific custom label on yAxis label for specific plot only?

I am looking for solution to add custom text labels on yAxis with highcharts for selected plot only.
I have 3 plot items/legends among which one should have custom string to show on yAxis instead of default values and rest keep showing default label at yAxis.
I know we can use this
yAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
but this is going to show the categories/yAxis label with all plot/legends values, I want to show above categories with specific plot/legends only. Such that if any one click load page, chart show the provided data with default labels but clicking on this plot will show yAxis label provided by me.
I am using spline highchart.
You can find similar example here:
https://www.highcharts.com/demo/spline-plot-bands
The chart on the link mentioned above have 2 bands and its y-axis is showing plot-bands. In my case, I have total of 3 bands (say yellow, black and blue bands) to show among them plot bands is required to show with only 1 band (blue band). So when user click on blue band only then plot bands should appear on the chart.
I have total of 7 charts. Among them 2 of them are not going to have blue band and the whole code is centralised so I am not using separate code for each chart.
Thanks

Highcharts markers on legend and hover ONLY

I need to show highchart markers only on hover state and in the legend at all times. I don't want it to show on normal state in the chart. I searched for this and found this post which did not work for me
Series markers disable on lines and enable on legend in Highchart
You can reset drawPoints function.
Highcharts.Series.prototype.drawPoints = function() { };
Example: http://jsfiddle.net/11pLzk9m/1/

Changing the contents of Highcharts legend

When using Highcharts, is it possible to change the contents of the legend to display something other than the series?
For example, I have a scatter chart with just one series but with many elements, so that the element labels obstruct one another and are illegible:
Would it be possible to use the legend to display the element names instead of the series? (each member in the series has a different color so that it is possible to use the legend in this case)
EDIT:
It turns out there isn't any good way to do this, so I wrote my own custom legend. You can find the code here: http://pastie.org/5115536
I hope you find it useful
Highcharts allows to show data points instead of series name in the in the legend. But, Unfortunately its only for Pie charts type:pie.
There is a default option available for the Pie Chart though undocumented in the API.
legendType: 'point',
If you try to set it for other type of chart, Legend does not gets rendered.

Resources