如何在Highcharts.js中隐藏/禁用图例框? [英] How to hide/disable the legend box in Highcharts.js?
本文介绍了如何在Highcharts.js中隐藏/禁用图例框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想问问是否可以使用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);
任何帮助将不胜感激.
推荐答案
好吧,我发现最简单的方法就是将 legend属性添加到chart_object并设置为 enabled设置为false:样本:
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,
(...)
这篇关于如何在Highcharts.js中隐藏/禁用图例框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文