Repository navigation
feat(pulse): add a second Y axis on the right - #39
Merged
Merged
Conversation
WithRightAxis adds a right Y axis with its own range, ticks and formatter, and WithSeriesRightAxis plots a series against it. Right labels sit on the rows of their own ticks; the grid follows the left ticks. The legend marks right-axis series with an arrow. Auto range, thresholds and negative styles stay on the left axis. Closes #12
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds a second Y axis on the right, so two metrics on different scales, such as CPU in percent and requests per second, share one chart.
Axis{Min, Max, Ticks, Formatter},WithRightAxis/SetRightAxis/RightAxis(),WithSeriesRightAxis/SetSeriesRightAxis/SeriesRightAxis(). NaN and infinite bounds are ignored, as inSetRange.Viewgets one cell for the right axis line plus a label column as wide as the widest right label. The plot stayswwide, the height does not change, and the time axis rows keep their alignment (the axis row ends with┘).LegendandLegendBoxmark right-axis series with→.Viewmaps right-axis series into the left drawing space (also on a log scale) and gives renderers a wrappedChart;RenderContext.RightAxismarks those series. TheChartinterface does not change.docs/axes-and-grid.mdwith therightaxisscreenshot.Decision on the open question:
Issues
Closes #12
Type of Change
Checklist
gofmt,go vet).go test -race ./...) and everything builds (go build ./...andgo -C examples build ./...).