Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide/disable the legend box in Highcharts.js?

I would like to ask if it is possible to just hide all the legend box in a chart using HighCharts.js library?

var chart_object = {
chart: {
    renderTo: render_to,
    type: graph_type
},
colors:graph_colors,
title: {
    text: ''
},
xAxis: {
    min: 0,
    title: {
        text: x_axis.title,
        margin: 15
    },
    categories: categories,

},
(...)           
};

 // Create the chart
 var chart = new Highcharts.Chart(chart_object);

Any help will be appreciated.

like image 510
Alberto Montellano Avatar asked Jan 07 '14 22:01

Alberto Montellano


1 Answers

Well, the easiest way I've found to do that is just adding the legend attribute to chart_object and set enabled to false: Sample:

var chart_object = {
 chart: {
 renderTo: render_to,
 type: graph_type
},
legend:{ enabled:false },
colors:graph_colors,
(...)
like image 147
Alberto Montellano Avatar answered Oct 08 '22 20:10

Alberto Montellano