This project is read-only.

Datapoints for graphing?...

Mar 23, 2009 at 9:29 AM
Hi all,

I am currently in the early stages of developing an application using the TimeLineGraph object. What I am really stuck on is how to create a Datapoint object. I want to do this within the event handler of a button depending on a double value entered into a textbox. I have previously used Dundas Charting, and it is rather easy to do this but it seems there is no Datapoint object in the context menu for MSCUI when I am in the code view.

Can anyone please point me in the right direction on this!?....

Cheers.
Mar 24, 2009 at 3:47 PM

Hi Eleven_Eleven

Thanks for your interest in MSCUI. The following advice and code excerpt should help, but please let us know if you have any other questions.

Create an instance of "TimePoint" class, add the timepoints to a "FilteredCollection" and assign the "DataContext" property of the "TimeLineGraph" to the FilteredCollection.

 

Microsoft.Cui.Controls.FilteredCollection data = new Microsoft.Cui.Controls.FilteredCollection();

 

Microsoft.Cui.Controls.TimePoint timePoint = new Microsoft.Cui.Controls.TimePoint();

timePoint.Y1 = double.Parse(this.TextBox.Text);

timePoint.Value = DateTime.Now.ToString();

data.Add(timePoint);

 

this.TimeLineGraph.DataContext = data;

 

 

We are currently working on an update to the control to allow binding to any data that we expect to release soon. Watch out for the graphing control related blog entries on MSCUI in the near future as well.

Regards

Tom

Mar 24, 2009 at 4:12 PM
Hi Tom,

Thank you so much for your reply. This works a treat! I just had to add another line to call the graph's refresh method and it shows the datapoint. Thank you for such a helpful and insightful reply.

EE