Highcharts Get legend "icon" in tooltip - highcharts

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.

Related

Moving dataLabels for a Highcharts timeline all to one side

Is there a way to force a timeline series' dataLabels all to one side or the other?
I have a vertical timeline in Highcharts with several series (shown with "alternate: false"):
I would like to have, for instance, all of the "Sent for execution" labels on the left side. The "alternate" option moves some of them, but not all.
Okay, I found the answer while asking the question.
Set the "distance" option to a negative value with "alternate" as false. Here it is set to -100.

Google charts: is it possible to display tooltips when hovering areas in stacked area chart?

I have a stacked area chart using google charts. An example is here: https://code.google.com/apis/ajax/playground/?type=visualization#area_chart
The problem is, when I hover the cursor over an area, no tooltip is displayed. I need to hover the boundary of two neighboring areas to display the tooltip.
Is it possible to display tooltips when hovering areas? If not, do you know of some workaround?
You can use a SteppedAreaChart for this. Set isStacked to true, and by default the tooltips will be shown on hovering over an area.
No, you can't spawn the tooltips by hovering over the area. There is no way easy way to work around this, as the Visualization API does not trigger mouse events on the areas.
If you want to put the effort into this, you can create custom mouse event handlers on the chart's SVG/VML code. It might be possible to extrapolate which area the mouse is in, and given that, you can extrapolate the x-axis position from the mouse coordinates using the ChartLayoutInterface, and spawn a custom tooltip based on that information. Be aware that any solution involving the chart's SVG/VML code could break at any time, as the internal structure of the charts is not guaranteed to be stable from version to version.

How to fill area between two serieses in Hightcharts?

I would like to fill the area between two serieses (when serieses cross each other). See below. I tried the 'arearange' chart type but it filled most of the chart with solid colors. I saw a similar question but I wanted to know if Highcharts supports what I want or I have to use the solution posted in that question.
Chart now:
What I want:
type:'arearange'
You need to use three series, first / second as lines, third as arearange with defined values.
Related topic: How to fill the Area between two series with multiples yAxis in HighChart?

highcharts legend overlapping

highcharts legend overlapping with the name section of the series.
I have got an url : Issue example.
I want to place the legend text bellow the chart.
Please help.
You need to disable floating parameter or use y parameter (http://api.highcharts.com/highcharts#legend.y) to modify position.

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