css - 如何为标签使用 CSS3 背景线性渐变 (Highcharts)

标签 css background highcharts linear-gradients

我正在尝试设计 Highcharts 图表的样式,例如。 this one .

我正在寻找的是将 CSS3 背景线性渐变添加到 xAxis 和 yAxis 标签的解决方案。

有人已经启动并运行了类似的东西吗?或者 SVG 图表不可能吗?

谢谢。

最佳答案

您可以将标签的 useHTML 设置为 true,然后使用格式化程序定义您自己的 div 并使用 css3 样式,如下例所示:

labels: {
            useHTML: true,
            formatter: function () {
                return '<div class="label">' + this.value + ' </div>';
            }
        }

http://jsfiddle.net/MV4pb/

http://api.highcharts.com/highstock#xAxis.labels.formatter http://api.highcharts.com/highstock#xAxis.labels.useHTML

关于css - 如何为标签使用 CSS3 背景线性渐变 (Highcharts),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14748334/

相关文章:

javascript IE问题。仅在 IE 中不起作用

flutter - cron插件和Flutter中的Timer.periodic之间的区别

html - 为什么IE7没有背景图片?

javascript - 如何向 ember highchart 图表添加旋转事件?

css - 如何使 float 列垂直拉伸(stretch)以填充容器?

css - Bootstrap 4 : Extra whitespace on right side of the screen

css - 菱形/旋转方形边框

Firefox 中的 css 渐变不是静态的

scala - 使用 Wisp scala 绘图库的字符串类别名称

javascript - Highcharts 不跟踪填充区域下的鼠标事件