Skip to content

SignalConst: Enable LegendText, increase default marker size, and fix first point position#4082

Merged
swharden merged 6 commits intoScottPlot:mainfrom
KroMignon:fix_4081
Jul 24, 2024
Merged

SignalConst: Enable LegendText, increase default marker size, and fix first point position#4082
swharden merged 6 commits intoScottPlot:mainfrom
KroMignon:fix_4081

Conversation

@KroMignon
Copy link
Contributor

SignalConst has as LegendText field but did not defines LegendItems!

Also change LineStyle initialization for set Width to 1.

This should fix issue #4081.

Doing this, I found a bug in SignalConst rendering for first points:

ScottPlot.Plot myPlot = new();

var sign = myPlot.Add.SignalConst(Generate.Sin(phase:Math.PI));
sign.LegendText = "My fabulous SignalConst LegendText";
var sign2 = myPlot.Add.Signal(Generate.Sin());
sign2.LegendText = "My fabulous Signal LegendText";
myPlot.ShowLegend();
myPlot.SavePng("bug_4081.png", 800, 600);

bug_4081

SignalConst has as LegendText field but did not defines LegendItems!

Also change LineStyle initialization for set Width to 1
Fix marker drawing based on Signal
@KroMignon
Copy link
Contributor Author

I also fixed the Marker rendering based on the it was done in Signal and backport the fix for issue #4083 as it was done by @StendProg in #4086.

@swharden swharden enabled auto-merge (squash) July 24, 2024 01:30
@swharden swharden changed the title SP5: Fix LegendItems in SignalConst SignalConst: Enable LegendText, increase default marker size, and fix first point position Jul 24, 2024
@swharden swharden merged commit da51751 into ScottPlot:main Jul 24, 2024
@swharden swharden linked an issue Jul 24, 2024 that may be closed by this pull request
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.

SignalConst not support LegendText

2 participants