博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HighCharts设置图表背景透明
阅读量:6930 次
发布时间:2019-06-27

本文共 2124 字,大约阅读时间需要 7 分钟。

其实就一句话:

 backgroundColor: 'rgba(0,0,0,0)'

完整示例:

 

$(function () {        $('#container').highcharts({            chart: {                type: 'column',                backgroundColor: 'rgba(0,0,0,0)'            },            title: {                text: 'Stacked column chart'            },            xAxis: {                categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']            },            yAxis: {                min: 0,                title: {                    text: 'Total fruit consumption'                },                stackLabels: {                    enabled: true,                    style: {                        fontWeight: 'bold',                        color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'                    }                }            },            legend: {                align: 'right',                x: -70,                verticalAlign: 'top',                y: 20,                floating: true,                backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',                borderColor: '#CCC',                borderWidth: 1,                shadow: false            },            tooltip: {                formatter: function() {                    return ''+ this.x +'
'+ this.series.name +': '+ this.y +'
'+ 'Total: '+ this.point.stackTotal; } }, plotOptions: { column: { stacking: 'normal', dataLabels: { enabled: true, color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white' } } }, series: [{ name: 'John', data: [5, 3, 4, 7, 2] }, { name: 'Jane', data: [2, 2, 3, 2, 1] }, { name: 'Joe', data: [3, 4, 4, 2, 5] }] }); });

 

还有另外一个属性,plotBackgroundColor: null

这个属性的意思是指图表部分,不含标题、说明信息,x轴y轴上的提示信息等部分的背景色,例如:

 

转载地址:http://xopjl.baihongyu.com/

你可能感兴趣的文章
在CentOS服务器上安装配置LEMP的详细教程
查看>>
挂载新硬盘CENTOS6.4
查看>>
Extjs 动态改变grid的store加载路由
查看>>
fedora17 下(Broadcom Corporation BCM4312)的安装
查看>>
win32下PE文件分析之NT头
查看>>
Java常见问题分析
查看>>
python脚本: 计算节点创建cgroups绑定虚拟核心,实现计算资源隔离
查看>>
tomcat基于域名虚拟主机
查看>>
spring 实现 接口 加密。
查看>>
commons-lang3:ClassPathUtils
查看>>
Nginx配置文件详细说明
查看>>
python核心编程-第十章-个人笔记
查看>>
Debain update apache error AH00111: Config variable ${APACHE_RUN_DIR} is not defined
查看>>
使用SIP对C库进行Python封装
查看>>
Linux screen命令详解
查看>>
Java中的封装
查看>>
高校信息化现状
查看>>
GlusterFS-动态卷快速应用
查看>>
函数调用规范__cdecl和__stdcall的区别
查看>>
linux中bin与sbin目录的作用及区别介绍
查看>>