我正在尝试设计 Highcharts 图表的样式,例如。 this one .
我正在寻找的是将 CSS3 背景线性渐变添加到 xAxis 和 yAxis 标签的解决方案。
有人已经启动并运行了类似的东西吗?或者 SVG 图表不可能吗?
谢谢。
最佳答案
您可以将标签的 useHTML 设置为 true,然后使用格式化程序定义您自己的 div 并使用 css3 样式,如下例所示:
labels: {
useHTML: true,
formatter: function () {
return '<div class="label">' + this.value + ' </div>';
}
}
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/