简体   繁体   English

如何为高图图表添加框阴影?

[英]How to add box shadow for highchart chart?

I want to have the following style on my chart border 我想在图表边框上使用以下样式

border-radius: 4px;
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
border: solid 1px #e1e1e1;

There is shadow property for the chart but it doesn't seem to work, can someone point out my mistake? 图表有阴影属性,但它似乎不起作用,有人可以指出我的错误吗?

Thanks 谢谢

Here is the jsfiddle 这是jsfiddle

Edit: I want it to look like this 编辑:我希望它看起来像这样

在此输入图像描述

Change shadow , offsetX and offsetY to a number instead of string: shadowoffsetXoffsetY更改为数字而不是字符串:

Highcharts.chart('container', {
    chart: {
        shadow: {
            color: 'rgba(0, 0, 0, 0.1)',
            offsetX: 1,
            offsetY: 1,
            opacity: '0.1',
            width: 10
        }
    }
});

Updated Fiddle 更新小提琴

Why not just apply it to the container? 为什么不将它应用到容器中? Here is the Jsfiddle 这是Jsfiddle

#container {
    border-radius: 4px;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
    border: solid 1px #e1e1e1;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM