Highcharts的Stacked percentage图表如何隐藏图例
时间:2011-11-30
来源:互联网
如何去掉下面的那个 单击 隐藏
http://www.highcharts.com/demo/column-drilldown
。。我已经改成这样了,还要修改哪里
var chart;
$(document).ready(function () {
var colors = Highcharts.getOptions().colors,
categories = ['成功', '失败'],
data = [{
y: 55.11,
color: colors[0]
}, {
y: 11.94,
color: colors[2]
}];
chart = new Highcharts.Chart({
chart: {
renderTo: 'cc',
type: 'column'
},
title: {
text: ''
},
subtitle: {
text: ''
},
xAxis: {
categories: categories
},
yAxis: {
title: {
text: ''
}
},
plotOptions: {
column: {
cursor: 'pointer',
dataLabels: {
enabled: true,
color: colors[0],
style: {
fontWeight: 'bold'
},
formatter: function () {
return this.y + '(个)';
}
}
}
},
tooltip: {
formatter: function () {
var point = this.point,
s = '运行' + this.x + '的有' + ':<b>' + this.y + '个</b><br/>';
return s;
}
},
series: [{
name: '', //这边。一旦name=空或者null 会自动加上一个series1.,,series整个去掉的话,图又显示不出来。
data: data,
color: 'red'
}],
exporting: {
enabled: false
}
});
});
作者: q2104574 发布时间: 2011-11-30
测试例子:http://jsfiddle.net/9uMzq/
参考如下代码:
JScript code
参考如下代码:
JScript code
var chart; $(document).ready(function () { var colors = Highcharts.getOptions().colors, categories = ['成功', '失败'], data = [{ y: 55.11, color: colors[0] }, { y: 11.94, color: colors[2] }]; chart = new Highcharts.Chart({ chart: { renderTo: 'cc', type: 'column' }, title: { text: '' }, subtitle: { text: '' }, xAxis: { categories: categories }, yAxis: { title: { text: '' } }, plotOptions: { column: { cursor: 'pointer', dataLabels: { enabled: true, color: colors[0], style: { fontWeight: 'bold' }, formatter: function () { return this.y + '(个)'; } } }, series: { showInLegend: false } }, tooltip: { formatter: function () { var point = this.point, s = '运行' + this.x + '的有' + ':<b>' + this.y + '个</b><br/>'; return s; } }, ignoreHiddenSeries: true, series: [{ name: '', //这边。一旦name=空或者null 会自动加上一个series1.,,series整个去掉的话,图又显示不出来。 data: data, color: 'red' }], exporting: { enabled: false } }); });
作者: zswang 发布时间: 2011-11-30
关键位置:
plotOptions: {
//.....
series: {
showInLegend: false
}
},
plotOptions: {
//.....
series: {
showInLegend: false
}
},
作者: zswang 发布时间: 2011-11-30
查api文档可以找到相关信息:
http://www.highcharts.com/ref/
http://www.highcharts.com/ref/
作者: zswang 发布时间: 2011-11-30
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28