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

Is this possible?

3 Answers 56 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 07 Oct 2009, 01:50 PM
Ok I have a cool idea but I don't know if I can pull it off...

I have a chart for a dashboard that displays metrics data in a stack for every day of the current week. 
I load all of the days of the week except for the current day using a query into an archive data warehouse table.
I pull the current days data from current tables.

This works well but my goal is to display this data on a dash console in the office and update the chart every 15 seconds.  
I only want to update the current day's bar though....  I don't want to refresh the whole control.

i.e.

if today is Tuesday I want to display Sat, Sun, Mon, Tue values but I want to refresh Tue every 15 seconds and only re-paint the bars for Tuesday.

Is this possible?
Thanks,
Tim

3 Answers, 1 is accepted

Sort by
0
Tim
Top achievements
Rank 1
answered on 07 Oct 2009, 02:28 PM
I just had an epiphany!
What if I used 2 series mappings?
Can I setup a series map for the old data and then add another series map for the current day and just remove and add the series map for the current day.  Will this cause only the series map for the current day to be repainted without repainting the old series map?

0
Tim
Top achievements
Rank 1
answered on 07 Oct 2009, 03:36 PM
Ok now I'm on a new idea.....
Based on some helpful links from a previous post, I am at least aware that the controls can be used with the INotifyCollectionChaged event.  I'm assuming that means if I bind my data to the object that it will update itself...

Very cool are there any examples that anyone has seen of this?
Thanks,
Tim
0
Velin
Telerik team
answered on 09 Oct 2009, 03:33 PM
Hello Tim,

Indeed the current version of the control supports automatic updates to change notifications coming from the items source. Here is the sample code:
    ObservableCollection<ChartData> data;
    public Page()
    {
        InitializeComponent();
        Loaded += new RoutedEventHandler(Page_Loaded);
    }
 
    void Page_Loaded(object sender, RoutedEventArgs e)
    {
 
        data = new ObservableCollection<ChartData>()
                            {
                                new ChartData(5, 5, Colors.Brown),
                                new ChartData(6, 6, Colors.Blue),
                                new ChartData(7, 7, Colors.Cyan)
                            };
 
        SeriesMapping m = new SeriesMapping();
        m.SeriesDefinition = new BarSeriesDefinition();
 
        m.ItemMappings.Add(new ItemMapping() { DataPointMember = DataPointMember.YValue, FieldName = "YValue" });
        RadChart1.SeriesMappings.Add(m);
        RadChart1.ItemsSource = data;
    }
}

Where the ChartData type implements the INotifyPropertyChanged interface.

Attached is the sample application as well.

All the best,
Velin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Chart
Asked by
Tim
Top achievements
Rank 1
Answers by
Tim
Top achievements
Rank 1
Velin
Telerik team
Share this question
or