I am working with a PieChart and have to render the legend separately and cannot use the normal PieChart legend. My legend is missing the mouseover and onclick functionality. Is there a way to call these functions from my custom legend?
Related
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/
I am creating a chart which internally is built using multiple highcharts.I want to create a custom legend for whole chart. Is there a way to show custom legend. Is yes then can someone point me to some example.
I have a system set up where the user adds a chart and then selects the type they want. If I add the chart with the colorAxis in place, how do I hide it or remove it for those charts where I don't need it?
If I create the chart without the colorAxis, what is the proper way to add the colorAxis? I tried using the addAxis just like you would for any other axis, but there are problems. The remove function removed the colorAxis from the chart object, but not from the chart. It also resulted in an error.
You can destroy colorAxis by remove legend.
chart.legend.destroy();
Example: http://jsfiddle.net/h0rkf05t/
I want to draw bar to pie chart with Highcharts like this
is it possible !?
I have a chart that has a custom legend i.e. it isn't part of Highcharts at all, it's completely my own code, the Highcharts legend is disabled for this chart.
Is it possible to turn series data AND plot bands on/off in a Highcharts chart using the API?
I found an example that triggered the click event of a legend item to do this, but this obviously relies on a legend being present, so this is no use to me: http://birdchan.com/home/2013/01/23/trigger-a-click-event-on-a-legend-item-in-highchart/
I also tried to set the series data .visible property to false and then redraw the chart and although it sets the visible property just fine, it doesn't redraw the chart so nothing changes:
var chart = new Highcharts.Chart(myoptions);
$("#custom_legend_link").click(function (e) {
chart.series[0].visible = !chart.series[0].visible;
chart.redraw();
}
Here is a jsFiddle using the basic line demo showing my problem:
http://jsfiddle.net/gfyans/zsaV4/
Thanks,
Greg.
To toggle the series, use Series.setVisible(). When called without parameters, it toggles.
Plot bands are a bit different, since they don't have methods like hide(), show() or setVisible. To toggle a plot band, you need to remove it by Axis.removePlotBand() and add a new one with the same options by Axis.addPlotBand().