-
Notifications
You must be signed in to change notification settings - Fork 19.7k
Animate stacked bars in Bar Series from the 'bottom' #20862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -783,9 +783,18 @@ const elementCreator: { | |||||
rect.name = 'item'; | ||||||
|
||||||
if (animationModel) { | ||||||
const isStacked = seriesModel.get('stack') !== undefined; | ||||||
const rectShape = rect.shape; | ||||||
const animateProperty = isHorizontal ? 'height' : 'width' as 'width' | 'height'; | ||||||
rectShape[animateProperty] = 0; | ||||||
if (isStacked) { | ||||||
// if it's stacked, the bar will be animated from the | ||||||
// 'bottom' of the value axis, irregardless of 'inverse' | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Replace 'irregardless' with 'regardless' for clarity and formal tone.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in 444c75d |
||||||
const stackAnimateProperty = isHorizontal ? 'y' : 'x' as 'y' | 'x'; | ||||||
const coordSys = (seriesModel.coordinateSystem as Cartesian2D); | ||||||
const extent = coordSys.getOtherAxis(coordSys.getBaseAxis()).getGlobalExtent()[0]; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep seems like you are correct, for nani.mp4The other half of the video describes a bug (not sure): the right most bar stack in that video isn't placed correctly (not respecting I'll fix the startValue issue in a bit; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in 444c75d - but will add tests in another commit |
||||||
rectShape[stackAnimateProperty] = extent; | ||||||
} | ||||||
} | ||||||
return rect; | ||||||
}, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!= null
should be better.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 444c75d