This project is read-only.

Sparrow Toolkit and Animation

Oct 9, 2014 at 11:49 AM
Hi, I'm trying to use the sparrow toolkit to create animated charts in wp8. I have taken a simple area chart example and tried to see if I can make it animate.

This is my xaml code
<sparrow:SparrowChart Name="MyChart" Height="400" Width="400">
                <sparrow:SparrowChart.Triggers>
                    <EventTrigger RoutedEvent="sparrow:SparrowChart.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation 
                                    Storyboard.TargetName="MyChart"
                                    Storyboard.TargetProperty="Height"
                                    From="100" To="400" Duration="0:0:2">                                    
                                </DoubleAnimation>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </sparrow:SparrowChart.Triggers>
                <sparrow:SparrowChart.XAxis>
                    <sparrow:LinearXAxis CrossLineStyle="{StaticResource crossLineStyle}" MinorLineStyle="{StaticResource minorcrossLineStyle}" MajorLineStyle="{StaticResource crossLineStyle}" AxisLineStyle="{StaticResource axisLineStyle}"/>
                </sparrow:SparrowChart.XAxis>
                <sparrow:SparrowChart.YAxis>
                    <sparrow:LinearYAxis CrossLineStyle="{StaticResource crossLineStyle}" MinorLineStyle="{StaticResource minorcrossLineStyle}" MajorLineStyle="{StaticResource crossLineStyle}" AxisLineStyle="{StaticResource axisLineStyle}"/>
                </sparrow:SparrowChart.YAxis>
                <sparrow:AreaSeries Fill="Red" Stroke="Red">
                    <sparrow:AreaSeries.Points>
                        <sparrow:DoublePoint Data="0" Value="1"/>
                        <sparrow:DoublePoint Data="1" Value="2"/>
                        <sparrow:DoublePoint Data="2" Value="1"/>
                        <sparrow:DoublePoint Data="3" Value="4"/>
                        <sparrow:DoublePoint Data="4" Value="0"/>
                    </sparrow:AreaSeries.Points>
                </sparrow:AreaSeries>
            </sparrow:SparrowChart>
When I run this code I get the following exception
{System.Windows.Markup.XamlParseException: Failed to assign to property 'System.Windows.EventTrigger.RoutedEvent'. [Line: 36 Position: 47]
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at AreaChartTest.MainPage.InitializeComponent()
at AreaChartTest.MainPage..ctor()}

Can somebody explain to me what the problem is?
Oct 14, 2014 at 7:32 AM
Edited Oct 14, 2014 at 7:35 AM
Hi, i tried your code and everything is working although I did remove few lines
here is the result I got, and here is the code I used: Link
I just removed the styles you assigned for x and y axis. Animation is working too
Image
Oct 14, 2014 at 11:36 AM
Hi, Thanks for your reply.

In the meantime I opted for another library to use, but I will try your code just for the sake of it.
If the animation looks good I might change back to sparrow.
Thanks again
Oct 14, 2014 at 11:38 AM
You're welcome. Happy that I was able to help.
Good luck Mr. Corcus