Skip to content

bar: place value below bars when value is negative#4833

Merged
swharden merged 2 commits intomainfrom
4760
Mar 2, 2025
Merged

bar: place value below bars when value is negative#4833
swharden merged 2 commits intomainfrom
4760

Conversation

@swharden
Copy link
Member

@swharden swharden commented Mar 2, 2025

image

List<Bar> bars = [];
for (int i = 0; i < 10; i++)
{
    double value = Generate.RandomInteger(-100, 100);
    bars.Add(new()
    {
        Position = i,
        Value = value,
        Label = value.ToString(),
        FillColor = Colors.C0,
        LineWidth = 0,
    });
}

Plot plot = new();
var barPlot = plot.Add.Bars(bars);
barPlot.ValueLabelStyle.FontSize = 18;
barPlot.ValueLabelStyle.Bold = true;

plot.Axes.Margins(0.1, 0.25); // increase vertical margins to make room for labels

plot.Add.HorizontalLine(0, 1, Colors.Black, LinePattern.DenselyDashed);
plot.HideGrid();

so descending SignalXY tests fail reliably
@swharden swharden merged commit ca122df into main Mar 2, 2025
3 checks passed
@swharden swharden deleted the 4760 branch March 2, 2025 19:11
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.

Bar: add option to place label below/above the bar if its value is negative/positive

1 participant