This is a migrated thread and some comments may be shown as answers.

Scatter plot with a 3rd value reprensented by color

1 Answer 54 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Sigfredo asked on 24 Dec 2018, 01:34 AM

I would like to plot data on a scatter chart with 3 values, for example, x value (double type, frequency), y value (date/time, date and time) z value (double type, amplitude). z value having a color legend representing the value.  Something like the attached intensity plot.




1 Answer, 1 is accepted

Sort by
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Dec 2018, 08:42 AM
Hello, Sigfredo,     

By design, ScatterSeries in RadChartView plots its data upon two numerical axes. Scatter series identify the position of each ScatterDataPoint using two numerical values - XValue and YValue for the horizontal and vertical axes respectively, just like in the typical Cartesian coordinate system. It doesn't expect a third value.

I can suggest you using a RadChartView together with a RadLinearGauge for the colored values ranges. Additional information about the RadLinearGauge is available in the following help article:

In order to customize the scatter points according to the value it stores, once the chart is populated with the series, you can iterate the ScatterSeries.Children collection and specify the ScatterPointElement.BackColor according to your custom requirements. You can find below a sample code snippet how to color the scatter points with a different random color:

ScatterSeries scatterSeries = new ScatterSeries();
scatterSeries.Name = "";
scatterSeries.DataPoints.Add(new ScatterDataPoint(15, 19));
scatterSeries.DataPoints.Add(new ScatterDataPoint(18, 10));
scatterSeries.DataPoints.Add(new ScatterDataPoint(13, 15));
scatterSeries.DataPoints.Add(new ScatterDataPoint(10, 8));
scatterSeries.DataPoints.Add(new ScatterDataPoint(5, 12));
scatterSeries.PointSize = new SizeF(8, 8);
Random rand = new Random();
foreach (ScatterPointElement point in scatterSeries.Children)
    point.BackColor = Color.FromArgb(rand.Next(0, 255), rand.Next(0, 255), rand.Next(0, 255));

I hope this information helps. 

Merry Christmas 

Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question