Skip to content

Bar Plot: Show negative values below bar#2159

Merged
swharden merged 9 commits intoScottPlot:mainfrom
bclehmann:fix/show-negatives-below-bar
Oct 8, 2022
Merged

Bar Plot: Show negative values below bar#2159
swharden merged 9 commits intoScottPlot:mainfrom
bclehmann:fix/show-negatives-below-bar

Conversation

@bclehmann
Copy link
Member

@bclehmann bclehmann commented Oct 7, 2022

Purpose:
#2148

Note that this PR doesn't yet add this for BarSeries, I'm writing this between classes so I'll add it later.

The other question is whether this should be customizable, is drawing the text above negative bars always wrong (i.e. this is a bug fix), or should the user be able to choose that behaviour (i.e. this is a new feature). If it's the latter, I think we should preserve the previous behaviour of ShowValuesAboveBars and add ShowValuesAtTipOfBar or something similar.

double[] values = { 27.3, 23.1, -21.2, 16.1, 6.4, 19.2, 18.7, 17.3, 20.3, 13.1 };

var bar = plt.AddBar(values);
bar.ShowValuesAboveBars = true;
bar.Orientation = Orientation.Horizontal;

image

@swharden swharden linked an issue Oct 7, 2022 that may be closed by this pull request
@bclehmann
Copy link
Member Author

When adding this to BarSeries I also made the following fixes:

@bclehmann bclehmann marked this pull request as ready for review October 8, 2022 00:53
@swharden swharden enabled auto-merge October 8, 2022 23:06
@swharden swharden merged commit 8173568 into ScottPlot:main Oct 8, 2022
@swharden swharden mentioned this pull request Nov 6, 2022
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.

BarPlot: Tick labels should be displayed below negative bars

2 participants