Hello!
I'm using WinForms 2D chart with PointLineSeries as a scatter plot (Trial version).
And I need each point to have its own color depending on some parameter's value (not point's coordinates).
I couldn't achieve this with Palette.
Could you suggest me if it is possible to do this.
Thanks.
2D points custom coloring
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: 2D points custom coloring
Hi!
You can achieve that best by placing SeriesEventMarker on each data point location. You can give individual color and shape for every marker, and you can have thousands of them in the chart. To hide the label of the marker, set marker.Label.Visible = False.
I hope this helps
You can achieve that best by placing SeriesEventMarker on each data point location. You can give individual color and shape for every marker, and you can have thousands of them in the chart. To hide the label of the marker, set marker.Label.Visible = False.
I hope this helps
LightningChart Support Team, PT
-
- Posts: 4
- Joined: Tue Aug 09, 2016 10:04 am
Re: 2D points custom coloring
Thanks for the quick response.
Using SeriesEventMarker instead of SeriesPoint helped me to solve the problem with the color of the point, but significantly reduced the performance.
So much so that the application starts to have lags after 5-10 seconds.
I have 10 charts and i need to add 50 points and move them along axisX during 10 minutes.
But with SeriesEventMarker my application can not withstand the load even with one chart not speaking about 10 charts.
But if i use SeriesPoint performance is really good!
I used this code to test SeriesEventMarker:
Maybe I'm doing something wrong?
To be honest, it would be great If I could use Palette based on my parameter's value (not coordinates one).
Thanks.
Using SeriesEventMarker instead of SeriesPoint helped me to solve the problem with the color of the point, but significantly reduced the performance.
So much so that the application starts to have lags after 5-10 seconds.
I have 10 charts and i need to add 50 points and move them along axisX during 10 minutes.
But with SeriesEventMarker my application can not withstand the load even with one chart not speaking about 10 charts.
But if i use SeriesPoint performance is really good!
I used this code to test SeriesEventMarker:
Code: Select all
private void timer1_Tick(object sender, EventArgs e)
{
Random rand = new Random();
for (int i = 0; i < 50; i++)
{
SeriesEventMarker sem = new SeriesEventMarker();
sem.XValue = 0;
sem.YValue = rand.Next(0, 90);
sem.MoveByMouse = false;
sem.Label.Visible = false;
sem.Symbol.Color1 = (i % 3 == 0) ? Color.Aqua : (i % 2 == 0) ? Color.Red : Color.Blue;
sem.Symbol.Shape = Shape.Circle;
fpls1.SeriesEventMarkers.Add(sem);
}
for(int i = 0; i < fpls1.SeriesEventMarkers.Count; i++)
fpls1.SeriesEventMarkers[i].XValue += 10;
}
To be honest, it would be great If I could use Palette based on my parameter's value (not coordinates one).
Thanks.
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: 2D points custom coloring
Please use chart.BeginUpdate() ... chart.EndUpdate around your code, otherwise it will refresh on every marker adding and property change, causing major slowdown.
LightningChart Support Team, PT
-
- Posts: 4
- Joined: Tue Aug 09, 2016 10:04 am
Re: 2D points custom coloring
Even if I use chart.BeginUpdate() ... chart.EndUpdate() my application does not handle the load.
Maybe there is another way add points with individual color and not lose performance?
Link to my project:
https://drive.google.com/open?id=0B0omc ... 3hib2l4cTg
Maybe there is another way add points with individual color and not lose performance?
Link to my project:
https://drive.google.com/open?id=0B0omc ... 3hib2l4cTg
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: 2D points custom coloring
Hello,
thanks for sending the project. I used 9 charts, and pushed like 3000 markers in each chart. Yes, it gets slow with this marker amount. I was expecting pretty much a number like that.
Currently there's no other solution to color each data point individually.
Could you please contact our support by e-mail, introduce yourself, and ask about availability of custom point coloring built-in to the series. I briefly investigated our code and it looks coloring for requires work and API changes, but performance should be totally different from the 'markers' approach.
thanks for sending the project. I used 9 charts, and pushed like 3000 markers in each chart. Yes, it gets slow with this marker amount. I was expecting pretty much a number like that.
Currently there's no other solution to color each data point individually.
Could you please contact our support by e-mail, introduce yourself, and ask about availability of custom point coloring built-in to the series. I briefly investigated our code and it looks coloring for requires work and API changes, but performance should be totally different from the 'markers' approach.
LightningChart Support Team, PT
-
- Posts: 4
- Joined: Tue Aug 09, 2016 10:04 am
Re: 2D points custom coloring
Thank you for your help.
I will try to contact the support by e-mail with my problem.
I will try to contact the support by e-mail with my problem.