VChart
VChart copied to clipboard
[Bug] Line 分段有问题
Version
1.12.6
Link to Minimal Reproduction
1.12.6
Steps to Reproduce
const currentYear = '2024';
const spec = {
"type": "line",
"data": {
"values": [
{
"Date": "2024",
"Name": "电力功耗规划",
"Amount": 23.8
},
{
"Date": "2025",
"Name": "电力功耗规划",
"Amount": 23.8
},
{
"Date": "2026",
"Name": "电力功耗规划",
"Amount": 23.8
}
]
},
"xField": "Date",
"yField": "Amount",
"seriesField": "Name",
"padding": {
"top": 10,
"left": 0,
"right": 0,
"bottom": 5
},
"point": {
"visible": true,
"style": {
"size": 8,
fill: datum => datum.Date > currentYear ? '#97BCFF' : '#165DFF'
}
},
"line": {
"style": {
strokeOpacity: datum => datum.Date > currentYear ? 0.2 : 1
}
},
"label": {
"visible": true,
"style": {
"fontSize": 12,
fill: datum => datum.Date > 2024 ? '#737A87' : '#0C0D0E'
}
},
"axes": [
{
"orient": "left",
"label": {
"visible": false
}
},
{
"orient": "bottom",
"tick": {
// "tickCount": 5
}
}
],
"legends": {
"visible": false
},
"tooltip": {
"activeType": "dimension",
"dimension": {
"content": {}
}
}
}
const vchart = new VChart(spec, { dom: CONTAINER_ID });
vchart.renderSync();
setTimeout(() => {
vchart.updateSpec(spec);
vchart.renderSync();
}, [2000]);
// Just for the convenience of console debugging, DO NOT COPY!
window['vchart'] = vchart;
Current Behavior
Expected Behavior
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response