我有一个highcharts图表和figma文件看起来像下面的图片。Highcharts图表是sparkline chart。我如何将透明度和线性渐变效果添加到图表中?
的数据
deikduxw1#
迷你图使用许多area类型的图表,area系列的梯度可以通过series.fillColor选项添加,如下所示:
area
series.fillColor
示例代码:
series: [{ data: [1, 2, 3, 4, 5], fillColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, stops: [ [0, Highcharts.getOptions().colors[0]], [1, Highcharts.color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')] ] } }]
字符串
演示:https://jsfiddle.net/BlackLabel/ak1yrL0w/https://jsfiddle.net/BlackLabel/sr0xnw1d/API引用:https://api.highcharts.com/highcharts/series.area.fillColor
1条答案
按热度按时间deikduxw1#
迷你图使用许多
area
类型的图表,area
系列的梯度可以通过series.fillColor
选项添加,如下所示:示例代码:
字符串
演示:https://jsfiddle.net/BlackLabel/ak1yrL0w/https://jsfiddle.net/BlackLabel/sr0xnw1d/
API引用:https://api.highcharts.com/highcharts/series.area.fillColor