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

Dynamically adding and removing data poitns from a scatter series

1 Answer 53 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 25 Jul 2016, 02:01 PM

I was hoping on just using "this.chart.DataContext = { ... };" to refresh the data in my chart, however, I'm running into two issues with this:

1. Data only displays in the chart if the x-axis is categorical

2. I'm using up to 2048 data points and a categorical x-axis makes the tick marks illegible.

 

Unless there's a way to make the categorical axis to only display every hundredth tick mark, it looks like I'm forced into using linear axis for both the horizontal and vertical.

 

In referencing the newly released examples, the chart is bound to the "Source" collection in the separate ViewModelScatterSeries class. What would be the easiest way to update this information?

Using a different charting tool, I would create a new Observable collection, populate it, then assign it as the new item source. Is it possible to do this with the RadCartesian chart?

1 Answer, 1 is accepted

Sort by
0
Accepted
Lance | Manager Technical Support
Telerik team
answered on 26 Jul 2016, 07:03 PM
Hello Jason,

Can you share the model for your data points, a small sample of what your data looks like and summarize what you want the outcome to be (a mockup would be best)? With this I'll be able to better suggest what axes to use that would visualize your data the best.

Regarding the updating of the Charts' data source, you can indeed bind/set an ObservableCollection to the ScatterSeries.ItemsSource property and update the ObservableCollection directly. The ScatterSeries will render any changes to the ObservableCollection's items.

Note that if you replace the ObservableColleciton entirely, make sure you have PropertyChanged implemented. For example:

private ObservableCollection<T> chartData;
 
public ObservableCollection<T> ChartData
{
     get { return chartData ?? ( chartData = new ObservableCollection<T>()); }
     set { chartData= value; OnPropertyChanged();}
}


Regards,
Lance | Tech Support Engineer, Sr.
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Jason
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or