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

Updating MarkedZone

1 Answer 38 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Qwerty
Top achievements
Rank 1
Qwerty asked on 17 Apr 2012, 06:57 PM
I was trying to move a MarkedZone on my chart by changing its StartY and EndY in my code behind, but the MarkedZone disappears instead of moving to the new position unless I reload the silverlight app or refreshing the userControl. Is there anyway that I can make it update dynamically?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 23 Apr 2012, 07:47 AM
Hi,

We have tested your scenario by updating the marked zone on a button click and it works as expected on our side.Please, consider the following code snippet :
private void button_Click(object sender, RoutedEventArgs e)
        {
            MarkedZone markedzone = this.radChart.DefaultView.ChartArea.Annotations[0] as MarkedZone;
            markedzone.StartY = 0;
            markedzone.EndY = 1.5;
            markedzone.Background = new SolidColorBrush(Color.FromArgb(255, 248, 109, 90));
        }

Alternatively, you can clear all annotations on button click and set new ones if needed.

Hope this helps.

Greetings,
Nikolay
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Chart
Asked by
Qwerty
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or