Skip to content

feat: bar label position for horizontal bar charts#3546

Merged
swharden merged 7 commits intoScottPlot:mainfrom
aespitia:feature/aespitia/bar-label-position
Mar 31, 2024
Merged

feat: bar label position for horizontal bar charts#3546
swharden merged 7 commits intoScottPlot:mainfrom
aespitia:feature/aespitia/bar-label-position

Conversation

@aespitia
Copy link
Contributor

This PR is regarding issue #3520, the label placement for horizontal bar charts was always on top, this moves labels for horizontal bar charts to either left or right, depending on negative or positive value of the bar.

Included a recipe called Bar with Value Labels (horizontal), looks like this attached image.

Some work may need to be done somewhere around adjusting the size of the container graph if the labels go outside of the drawing area?

image

@swharden
Copy link
Member

Thanks @aespitia, this looks great!

Some work may need to be done somewhere around adjusting the size of the container graph if the labels go outside of the drawing area?

myPlot.Axes.Margins(bottom: 0, top: .2); // before
myPlot.Axes.Margins(left: .2, right: .2); // after

image

@swharden swharden enabled auto-merge March 31, 2024 17:45
@swharden swharden merged commit a319fa6 into ScottPlot:main Mar 31, 2024
@aespitia aespitia deleted the feature/aespitia/bar-label-position branch April 1, 2024 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SP5 the behavior of Bar.Label is weird when BarPlot.Horizontal is true

2 participants