You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
simply navigate to stacked bar chart in ChartsDemo
highlight the top bar or bottom bar, or the middle one
click options and choose animate Y, and watch the animation
You will see the highlighted bar's rect animation is not correct, and the timing is not the same too. The highlighted bar should be same speed as the background bar's speed
Update:
This bug happens on stacked horizontal bar chart, normal bar chart, all bar charts type, as long as we have highlighted the bar.
The text was updated successfully, but these errors were encountered:
liuxuan30
changed the title
[BUG] highlighted bar animation on Y Axis for stacked bar chart is wrong and not same speed
[BUG] highlighted bar animation on Y Axis for all bar charts is wrong and not same speed
Sep 8, 2015
For the speed issue, I change y2 = (ranges?.last?.to ?? 0.0) * Double(_animator.PhaseY) to y2 = (ranges?.last?.to ?? 0.0) * Double(1) will solve it, though I am not quite clear why.
It seems because prepareBarHighlight will multiply _animator.phaseY again, so it causing the animation slower?
/// Prepares a bar for being highlighted.internalfunc prepareBarHighlight(#x: CGFloat, y1: Double, y2: Double, barspacehalf: CGFloat, trans: ChartTransformer, inout rect: CGRect){letbarWidth:CGFloat= 0.5
varleft= x - barWidth + barspacehalf
varright= x + barWidth - barspacehalf
vartop=CGFloat(y1)varbottom=CGFloat(y2)
rect.origin.x = left
rect.origin.y = top
rect.size.width = right - left
rect.size.height = bottom - top
trans.rectValueToPixel(&rect, phaseY: _animator.phaseY)<---}
Easy to reproduce:
You will see the highlighted bar's rect animation is not correct, and the timing is not the same too. The highlighted bar should be same speed as the background bar's speed
Update:
This bug happens on stacked horizontal bar chart, normal bar chart, all bar charts type, as long as we have highlighted the bar.
The text was updated successfully, but these errors were encountered: