-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
feat: Add show axis to timeseries #26409
Open
kainchow
wants to merge
9
commits into
apache:master
Choose a base branch
from
kainchow:add-show-axis-to-timeseries
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1aa0efa
Add ValuePercent option to LABEL TYPE for Pie and Funnel charts
kainchow 14a8a6e
Adding Show/Hide Axis Controls to Bar charts
kainchow 3a9eeee
Adding Show/Hide Axis Controls to Bar charts
kainchow 8dd90fb
Merge remote-tracking branch 'origin/add-show-axis-to-timeseries' int…
kainchow 8152126
Merge branch 'apache:master' into add-show-axis-to-timeseries
kainchow c3d31ea
Adding Show/Hide Axis Controls to Bar charts
kainchow 7c2529e
Merge remote-tracking branch 'origin/add-show-axis-to-timeseries' int…
kainchow 75835ee
Adding Show/Hide Axis Controls to Bar charts
kainchow 2b63425
Merge branch 'apache:master' into add-show-axis-to-timeseries
kainchow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[ViewState] | ||
Mode= | ||
Vid= | ||
FolderType=Generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -545,6 +545,7 @@ | |
legendOrientation: LegendOrientation, | ||
addYAxisTitleOffset: boolean, | ||
zoomable: boolean, | ||
showAxis: boolean, | ||
margin?: string | number | null, | ||
addXAxisTitleOffset?: boolean, | ||
yAxisTitlePosition?: string, | ||
|
@@ -559,6 +560,25 @@ | |
const yAxisOffset = addYAxisTitleOffset | ||
? TIMESERIES_CONSTANTS.yAxisLabelTopOffset | ||
: 0; | ||
// When the Y-axis is hidden, move the graph to the left to try to keep the graph centered | ||
const yAxisLeftOffset = showAxis | ||
? 0 | ||
: TIMESERIES_CONSTANTS.yAxisLabelLeftOffset; | ||
let leftOffset: number; | ||
if (yAxisTitlePosition === 'Left' && showAxis) { | ||
leftOffset = | ||
TIMESERIES_CONSTANTS.gridOffsetLeft + (Number(yAxisTitleMargin) || 0); | ||
} else if (yAxisTitlePosition === 'Left' && !showAxis) { | ||
leftOffset = | ||
TIMESERIES_CONSTANTS.gridOffsetLeft + | ||
(Number(yAxisTitleMargin) || 0) - | ||
(Number(yAxisLeftOffset) || 0); | ||
} else if (yAxisTitlePosition !== 'Left' && !showAxis) { | ||
leftOffset = | ||
TIMESERIES_CONSTANTS.gridOffsetLeft - (Number(yAxisLeftOffset) || 0); | ||
} else { | ||
leftOffset = TIMESERIES_CONSTANTS.gridOffsetLeft; | ||
} | ||
Comment on lines
+564
to
+581
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. This is maybe slightly heavy on the eyes. Would it be possible to add a few comments here explaining what's going on? Or better yet, maybe add a few self explanatory tests? |
||
const xAxisOffset = addXAxisTitleOffset ? Number(xAxisTitleMargin) || 0 : 0; | ||
return getChartPadding(showLegend, legendOrientation, margin, { | ||
top: | ||
|
@@ -568,10 +588,7 @@ | |
bottom: zoomable | ||
? TIMESERIES_CONSTANTS.gridOffsetBottomZoomable + xAxisOffset | ||
: TIMESERIES_CONSTANTS.gridOffsetBottom + xAxisOffset, | ||
left: | ||
yAxisTitlePosition === 'Left' | ||
? TIMESERIES_CONSTANTS.gridOffsetLeft + (Number(yAxisTitleMargin) || 0) | ||
: TIMESERIES_CONSTANTS.gridOffsetLeft, | ||
left: leftOffset, | ||
right: | ||
showLegend && legendOrientation === LegendOrientation.Right | ||
? 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This appears to be here twice