Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal Plot: color lines and markers separately #2288

Closed
Nuliax7 opened this issue Dec 7, 2022 · 3 comments
Closed

Signal Plot: color lines and markers separately #2288

Nuliax7 opened this issue Dec 7, 2022 · 3 comments

Comments

@Nuliax7
Copy link

Nuliax7 commented Dec 7, 2022

ScottPlot Version: 4.1.59

Operating System: Windows 11

Application Type: WPF

Question:
The last color set changes everything.
For example: if white is indicated for the line, and red is indicated for the marker on the next line, then the entire line and markers will be red. Or vice versa, if you first specify the marker in red and the line is white, then everything will be white.
This happens if Signal Plot is selected.
Is this the right behavior? As expected, the different specified colors should be displayed differently. Looks like a bug.

var plot = Chart.Plot.AddSignalXYConst(times, prices); 
plot.MarkerColor = Color.Red;
plot.Color = Color.White;

изображение


var plot = Chart.Plot.AddSignalXYConst(times, prices); 
plot.Color = Color.White;
plot.MarkerColor = Color.Red;

изображение

I tried to set the color for other properties, the behavior is the same.

@StendProg
Copy link
Contributor

Hi @Nuliax7,
It looks like it was originally intended.
And it looks like you are the first one who had the idea to set different colors.
Different properties share one color:

public Color Color { get; set; } = Color.Green;
public Color LineColor { get => Color; set { Color = value; } }
public Color MarkerColor { get => Color; set { Color = value; } }

@Nuliax7
Copy link
Author

Nuliax7 commented Dec 8, 2022

@StendProg,
Thanks for the reply. There are still doubts that this was intended. In the scatter plot it works differently (normally, expected).

@swharden
Copy link
Member

Thanks for the suggestion @Nuliax7! I'm making the change now to allow lines and markers to be colored independently and will add this example to the cookbook

double[] values = DataGen.Sin(51);
var sig = plt.AddSignal(values);

sig.LineColor = Color.LightBlue;
sig.LineWidth = 3;
sig.MarkerColor = Color.Blue;

image

@swharden swharden changed the title Signal Plot colors problem Signal Plot: color lines and markers separately Dec 22, 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

No branches or pull requests

3 participants