Closed skie1997 closed 2 months ago
通过如下配置自行计算timeSlices解决:
"animationNormal": {
"bar": [
{
"loop": false,
"controlOptions": {
"immediatelyApply": false
},
"timeSlices": [
{
"effects": {
"channel": {
// fill: {
// to: "linear-gradient(0deg, red 0%, blue 100%)",
// },
// stroke: {
// to: "linear-gradient(0deg, black 0%, blue 100%)"
// }
"fill": {
to: color,
from: (...p) => {
return p[1].graphicItem.attribute.fill;
}
} // fillOpacity: {
// to: 0.2
// }
},
"easing": "linear"
},
delay: (datum, element, context, global) => {
const { count, index } = getGroupInfo(global.vchart, datum)
console.log('loopDuration', loopDuration, count)
// initial delay + one by one delay
return index * loopDuration / count;
},
// delayAfter: 6000,
"duration": (datum, element, context, global) => {
const { count, index } = getGroupInfo(global.vchart, datum)
// initial delay + one by one delay
return loopDuration / count / 2;
}
},
{
"effects": {
"channel": {
// fillOpacity: {
// from: 0.2,
// to: 1
// }
"fill": {
from: color,
to: (...p) => {
return p[1].graphicItem.attribute.fill;
}
}
},
"easing": "linear"
},
delayAfter: (datum, element, context, global) => {
const { count, index } = getGroupInfo(global.vchart, datum)
// rest one by one delay
return interval + atmoDuration + (count - index - 1) * loopDuration / count;
},
"duration": (datum, element, context, global) => {
const { count, index } = getGroupInfo(global.vchart, datum)
// initial delay + one by one delay
return loopDuration / count / 2
}
}
]
},
{
"loop": false,
"delay": loopDuration,
"delayAfter": interval,
"duration": atmoDuration,
custom: StreamLight,
"easing": "quintIn",
"customParameters": {
"isHorizontal": false,
"attribute": {
"fill": "#CFCFCF",
"blur": 0,
"shadowColor": "rgba(0,0,0,0)",
"height": 20
}
}
}
]
},
Version
1.11.5
Link to Minimal Reproduction
vscreen
Steps to Reproduce
Current Behavior
Expected Behavior
Environment
Any additional comments?
No response