Keep LineSerie Colors

Apr 27, 2013 at 12:30 AM
Edited Apr 27, 2013 at 12:39 AM
Currently I am using OxyPlot to plot vehicle trajectory data. The total number of lines would be around 2000. OxyPlot does a good job to render these lines efficiently and give them a different color automatically.

But I noticed that colors of lines would be changed if I remove one of lines. And it seems like the color would be rearranged by default color order, which is from green, khaki, red...

For example, I plot three vehicle trajectories below.

Image
(https://www.dropbox.com/s/xx2wygeoeg8sg4p/Screenshot_4_26_13_8_10_PM.png)

ID 2270 is in green. ID 2276 is in khaki. ID 2281 is in red. And the order I plot them is start from 2270, then 2276, finally 2281.

Image
(https://www.dropbox.com/s/pw6ptb0a6w1cadp/Screenshot_4_26_13_8_13_PM.png)

Now I remove ID 2276. Then ID 2281's color changed to be khaki from red.

I would like to know if there is a way to keep the line color as it will help user focus on certain line they are working on.

Here lists my code. It's quite simple.

var lineSerie = new LineSeries();

data.ToList().ForEach(d =>lineSerie.Points.Add(new DataPoint(Convert.ToDouble(d.X), Convert.ToDouble(d.Y))));

plotModel.Series.Add(lineSerie);

viewModel.plotModel.RefreshPlot(true);

:)
Thank you guys!
Coordinator
Apr 29, 2013 at 11:28 AM
I think you should keep your own list of colours, and set the colour for each series manually!
I see that OxyPlot could assign the automatic colour only once, but this requires some changes to the code. Create an issue if you think this is an important feature to add!
Coordinator
Apr 29, 2013 at 11:30 AM
btw, what kind of vehicles are you plotting trajectories for? I am curious :)