Is it possible to add line series to a chart control dynamically from the code behind?

2 Answers 55 Views
ChartView
Anup
Top achievements
Rank 1
Iron
Anup asked on 11 Dec 2023, 08:05 AM

Hi team,

 

I have a scenario where we need to add line series to the chart dynamically from code behind and I need to bind live data (i.e, data changes for every 2 seconds) . I am using Telerik UI for WinForms controls . 

One static line series work perfectly fine using the demo sample. The problem is adding 'n' number of line series and setting data every 2 seconds . In the sample , data is set using a global variable. but we need to achieve the same dynamically 

 

Can anyone guide on this

2 Answers, 1 is accepted

Sort by
1
Nadya | Tech Support Engineer
Telerik team
answered on 13 Dec 2023, 02:50 PM

Hello, Anup,

RadChartView can be bound to a wide variety of data-sources. It also supports binding to live data. Please refer to our Demo application >> ChartView >> Live Data example which demonstrates how the RadChartView can handle typical business scenarios where real-time process monitoring is required. It installs together with our suite and you can find the source code in its installation folder at: C:\Program Files (x86)\Progress\Telerik UI for WinForms R3 2023\Examples.

For displaying live data you need a timer, in which Tick event you can update the data source. If the timer is enabled, the live data is iterating. You can inspect how the data is loaded and updated when ticking the timer by using the custom implementation of the LiveDataModel in the code implementation in our demo example.

You can add the desired number of line series to the RadChartView.Series collection, however, it is not clear how many series you would like to have. Keep in mind that having too many series that use live data might affect the performance. 

You can refer to the following forum thread that might be useful on this topic: ChartView and Real time data in UI for WinForms | Telerik Forums

I hope this information is useful. If you have any other questions do not hesitate to ask.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Anup
Top achievements
Rank 1
Iron
answered on 13 Dec 2023, 03:56 PM
Thank you for the reply Nadya, we will try this.
Tags
ChartView
Asked by
Anup
Top achievements
Rank 1
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Anup
Top achievements
Rank 1
Iron
Share this question
or