我正在尝试完成一个对角线图案,其中包含带有此strokeWidth值的实线。到目前为止,这是我想出的,但是我似乎无法获得正确的d路径:
Highcharts.chart('container', {
chart: {
type: 'area'
},
title: {
text: 'Pattern fill plugin demo'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
plotOptions: {
area: {
fillColor: {
pattern: {
path: {
d: 'M 0 0 L 25 25 M 24 -1 L 26 1 M -1 24 L 1 26',
strokeWidth: 9
},
width: 25,
height: 25,
opacity: 0.2
}
}
}
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6],
color: '#88e',
fillColor: {
pattern: {
color: '#11d'
}
}
}, {
data: [null, null, null, null, null, 43.1, 95.6, 148.5, 216.4, 194.1, 95.6, 54.4],
color: '#e88',
fillColor: {
pattern: {
color: '#d11'
}
}
}]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/pattern-fill.js"></script>
<div id="container" style="height: 400px; max-width: 800px; margin: 0 auto"></div>
如果您查看该示例,则各行之间会出现中断。为了得到一条完整的对角线,我需要更改什么?预先感谢!
答案 0 :(得分:0)
更新:我可以使用d: 'M 0 0 L 25 25 M -5 20 L 5 30 M 20 -5 L 30 5'