This question is locked. New answers and comments are not allowed.
I have a business intelligence application, with a page that has to flip between two data bound rad charts.
The user can change the data the charts show, via combo boxes on the page.
Both rad charts are defined in XAML, and bound to observable collections. Individually, both charts work fine, and re-animate when a combo box selection is changed.
My issue is that I can't find a smooth transition between the two charts.
The solution I have tried, is to put both charts in one stack panel, set one charts visibility to collapsed, and then on a button, initate a story board to rotate the panel, whilst alternating the two charts visibility settings..
The story boards:-
The code:-
This works, however, the first time the code executes (when the second chart is set to visible for the first time), there is a noticable pause while the chart is rendered for the first time. This causes a stutterin the visual effect. Flipping the charts a second time results in a smooth animation, as the charts have both been rendered.
Once a new combo box selection has been made, the problem returns.
Is there a way to force the RadChart to render, even though it's visibility is set to collapsed, to ensure a smooth transition? Or possibly an alternative way of achieving a nice visual transition between charts. I did consider the RadTransition control, but don't really want to have to create the charts in code, as defining them in XAML and data binding works well, apart from this issue.
Any ideas would be appreciated.
Thanks
The user can change the data the charts show, via combo boxes on the page.
Both rad charts are defined in XAML, and bound to observable collections. Individually, both charts work fine, and re-animate when a combo box selection is changed.
My issue is that I can't find a smooth transition between the two charts.
The solution I have tried, is to put both charts in one stack panel, set one charts visibility to collapsed, and then on a button, initate a story board to rotate the panel, whilst alternating the two charts visibility settings..
The story boards:-
<
Storyboard
x:Name
=
"spFlip"
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
Storyboard.TargetName
=
"chartStack"
>
<
EasingDoubleKeyFrame
KeyTime
=
"0"
Value
=
"0"
/>
<
EasingDoubleKeyFrame
KeyTime
=
"0:0:0.3"
Value
=
"0.85"
/>
</
DoubleAnimationUsingKeyFrames
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"(UIElement.RenderTransform).(CompositeTransform.TranslateY)"
Storyboard.TargetName
=
"chartStack"
>
<
EasingDoubleKeyFrame
KeyTime
=
"0"
Value
=
"0"
/>
<
EasingDoubleKeyFrame
KeyTime
=
"0:0:0.3"
Value
=
"0.85"
/>
</
DoubleAnimationUsingKeyFrames
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"(UIElement.Projection).(PlaneProjection.RotationY)"
Storyboard.TargetName
=
"chartStack"
>
<
EasingDoubleKeyFrame
KeyTime
=
"0"
Value
=
"0"
/>
<
EasingDoubleKeyFrame
KeyTime
=
"0:0:0.3"
Value
=
"-90"
/>
</
DoubleAnimationUsingKeyFrames
>
</
Storyboard
>
<
Storyboard
x:Name
=
"spFlipBack"
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
Storyboard.TargetName
=
"chartStack"
>
<
EasingDoubleKeyFrame
KeyTime
=
"0"
Value
=
"0.85"
/>
<
EasingDoubleKeyFrame
KeyTime
=
"0:0:0.3"
Value
=
"0"
/>
</
DoubleAnimationUsingKeyFrames
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"(UIElement.RenderTransform).(CompositeTransform.TranslateY)"
Storyboard.TargetName
=
"chartStack"
>
<
EasingDoubleKeyFrame
KeyTime
=
"0"
Value
=
"0.85"
/>
<
EasingDoubleKeyFrame
KeyTime
=
"0:0:0.3"
Value
=
"0"
/>
</
DoubleAnimationUsingKeyFrames
>
<
DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty
=
"(UIElement.Projection).(PlaneProjection.RotationY)"
Storyboard.TargetName
=
"chartStack"
>
<
EasingDoubleKeyFrame
KeyTime
=
"0"
Value
=
"90"
/>
<
EasingDoubleKeyFrame
KeyTime
=
"0:0:0.3"
Value
=
"0"
/>
</
DoubleAnimationUsingKeyFrames
>
</
Storyboard
>
The code:-
void
spFlip_Completed(
object
sender, EventArgs e)
{
if
(Chart1.Visibility == Visibility.Collapsed)
{
Chart2.Visibility = Visibility.Collapsed;
Chart1.Visibility = Visibility.Visible;
}
else
{
Chart2.Visibility = Visibility.Visible;
Chart1.Visibility = Visibility.Collapsed;
}
spFlipBack.Begin();
}
This works, however, the first time the code executes (when the second chart is set to visible for the first time), there is a noticable pause while the chart is rendered for the first time. This causes a stutterin the visual effect. Flipping the charts a second time results in a smooth animation, as the charts have both been rendered.
Once a new combo box selection has been made, the problem returns.
Is there a way to force the RadChart to render, even though it's visibility is set to collapsed, to ensure a smooth transition? Or possibly an alternative way of achieving a nice visual transition between charts. I did consider the RadTransition control, but don't really want to have to create the charts in code, as defining them in XAML and data binding works well, apart from this issue.
Any ideas would be appreciated.
Thanks