Premium Analytics: Keep the first and last time-axis tick labels inside the chart - #52112
Premium Analytics: Keep the first and last time-axis tick labels inside the chart#52112chihsuan wants to merge 1 commit into
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Premium Analytics plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 3 files.
1 file is newly checked for coverage.
|
Fixes UNI-753.
Proposed changes
useChartMargin, so a label centred on the edge of the plot area no longer hangs outside the chart SVG.fontSize, which CSSOM drops, so they were otherwise measured at whatever the host body inherits.right: 0margin override from the Premium Analytics comparative line and bar charts, which is why the last date was clipped there.The y-axis half of
useChartMarginalready measures its widest label to size its gutter; the x-axis half only had a fixed 20px. Premium Analytics then overrode that to 0, on the reasoning that "the y-axis is on the left, so the right margin is always 0", which missed that the right margin is what the last x-axis label needs.Related product discussion/links
Does this pull request change what data or activity we track or use?
No.
Testing instructions
Before:
After: