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

Scatter plot of Y vs X for runtime list of objects

1 Answer 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 22 Aug 2017, 04:15 PM

I am using Telerik_Reporting_R2_2017_SP1_11_1_17_614.

I currently have a c# List of objects that I can calculate at runtime. Each object has the following class:

public class Thing {
    public DateTime XVal { get; set; } 
    public double YVal { get; set; } 
    public string Label { get; set; } 

}

XVal - is values usually range over several years with 10000s points (often but not always separated at 15 minute intervals). I only know the min and max values at runtime.

YVal - values are typically between 0 and 50, but I only know this range at runtime.

Label - 6 different labels that are known at runtime - not used at the moment (but long term I would like a different plot for each one).

To start, I would like to plot an x-y scatter plot of each element of the list (ignoring Label), such that each element of the list creates a point with coordinates (Xval, Yval). I have tried to follow the graph wizard tutorial, selected scatter plot and added X and Y arrays, set the category to the XVal and left the series blank. I then create a list of Thing objects and set the DataSource property of the scatter graph to that list. However, the plot always comes back with no data (min and max of both axes are 0 and 1 respectively). 

How can I create this scatter plot. 

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 23 Aug 2017, 02:44 PM
Now fixed. Solution was to convert the x axis to a date format axis and then update MajorUnit and LabelFormat properties using code at runtime depending on the range of time values.
Tags
General Discussions
Asked by
Richard
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Share this question
or