Show value in legend
Today one big problem is that when we have a Stock chart with around 5 series & data for about 3 years, the tooltip hides important data.
It'd be great to have an option to show the values aside the legend items instead of the tooltip like http://www.amcharts.com/stock/multiple-datasets/. That way we can make sure that the values are shown & nothing in the chart area is hidden from the viewer.
In the Highstock you can position the tooltip absolutely, which provides a similar effect: http://jsfiddle.net/highcharts/j7BSy/
// Updated 2013-07-22
To use a true legend, a plugin is needed. See http://jsfiddle.net/highcharts/DVvdZ/
I did a small modification today, so now it also works when tooltip.shared is false: http://jsfiddle.net/highcharts/DVvdZ/5/
hi, it is possible to use it on Highchart (not on StockChart). please can you share the code.
sorry for my bad english .
@Sujay I've updated the plugin now so it uses a smarter way to just replace the text, then reflow the legend.
@Torstein this seems to be creating numeric g elements of class "highcharts-legend-item" and the DOM count shoots within seconds on interacting with the chart. I'm not sure if the destroy method actually remove the element from the DOM. Something to check maybe.
@Torstein Thanks. I'll check the plugin.
@Eric, see my provided plugin in the status. I hope this helps. It can be extended to OHLC types. Regarding different colors for negative columns, see http://api.highcharts.com/highcharts#plotOptions.column.negativeColor.
Eric Lanteigne commented
Has this been fixed? As Sujay mentioned, the workaround is not a viable solution as it prevents toggling the visibility of charts. Also is there a way to have bar charts with a color for positive values and another color for negative values?
@Torstein Hønsi I'm currently using the workaround you can find @ http://jsfiddle.net/sujay/PUhsf/
There are known issues in such workarounds. The main issue being they are not actual legendItems, so we lose all the functionality of a legendItem, including
*click to toggle series visibility*,
*handling events on legendItem.element* & more.
Hence, it'd be great if we had an option to append tooltip values to the corresponding legendItems.