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

Null Reference StartTransitionAnimation with Time Bar

1 Answer 35 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 1
Grant asked on 02 Apr 2014, 05:30 AM
Hi,
I have a RadChart and RadTimeBar defined in XAML as follows. When I select the TimeBar in my RadWindow control I get the following exception:

<telerik:RadTimeBar Name="timeBar1" Grid.Row="0"
                    PeriodStart="{Binding StartDate, Mode=TwoWay}"
                    PeriodEnd="{Binding EndDate, Mode=TwoWay}"
                    VisiblePeriodStart="{Binding VisiblePeriodStart, Mode=TwoWay}"
                    VisiblePeriodEnd="{Binding VisiblePeriodEnd, Mode=TwoWay}"
                    SelectionStart="{Binding SelectionStart, Mode=TwoWay}"
                    SelectionEnd="{Binding SelectionEnd, Mode=TwoWay}"                                   
                    MinSelectionRange="{Binding MinSelectionRange, Mode=TwoWay}"
                    MaxSelectionRange="{Binding MaxSelectionRange, Mode=TwoWay}"
                    SelectionChanged="timeBar1_SelectionChanged">
    <telerik:RadTimeBar.Intervals>
        <telerik:YearInterval IntervalSpans="1" />
        <telerik:MonthInterval IntervalSpans="1,12" />
        <telerik:DayInterval IntervalSpans="1,5" />
        <!--<telerik:HourInterval IntervalSpans="1,30"/>-->
        <telerik:MinuteInterval IntervalSpans="1,30"/>
        <telerik:SecondInterval IntervalSpans="1,30"/>
    </telerik:RadTimeBar.Intervals>
    <telerik:RadScatterSparkline  x:Name="sparkLine" ItemsSource="{Binding FullRange}"  XValuePath="TimeStamp"  YValuePath="AvgVol"  Margin="0,3" />
</telerik:RadTimeBar>

<chart:RadChart x:Name="RadChartVol" ItemsSource="{Binding VolEvents}">
    <chart:RadChart.DefaultView>
        <charting:ChartDefaultView>
            <charting:ChartDefaultView.ChartArea>
                <charting:ChartArea LegendName="legend" EnableAnimations="True"  EnableTransitionAnimations="True" >
                    <charting:ChartArea.AxisY>
                        <charting:AxisY Title="Total Volume [Count]"/>
                    </charting:ChartArea.AxisY>
                    <charting:ChartArea.AxisX>
                        <charting:AxisX Title="Date" AutoRange="True" IsDateTime="True" DefaultLabelFormat = "MM-dd hh:mm" LabelRotationAngle="90" LayoutMode="Normal" />
                    </charting:ChartArea.AxisX>
                </charting:ChartArea>
            </charting:ChartDefaultView.ChartArea>
            <charting:ChartDefaultView.ChartLegend>
                <charting:ChartLegend Name="legend" Header="Detectors" />
            </charting:ChartDefaultView.ChartLegend>
        </charting:ChartDefaultView>
    </chart:RadChart.DefaultView>
    <chart:RadChart.TimeBar >
        <Binding ElementName="timeBar1" />
    </chart:RadChart.TimeBar>
</chart:RadChart>

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.RadTransitionControl.PrepareAnimation()
   at Telerik.Windows.Controls.Charting.ChartArea.StartTransitionAnimation()
   at Telerik.Windows.Controls.RadChart.StartTransitionAnimationIfEnabled()
   at Telerik.Windows.Controls.RadChart.UpdateTimeBarFilters()
   at Telerik.Windows.Controls.RadChart.TimeBarChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
   at Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
   at System.Windows.Data.BindingExpression.SendDataToTarget()
   at System.Windows.Data.BindingExpression.SourceAcquired()
   at System.Windows.Data.BindingExpression.PerformTargetLoaded()
   at System.Windows.Data.Debugging.BindingBreakPoint.<>c__DisplayClass4.<BreakOnSharedType>b__3()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)

1 Answer, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 04 Apr 2014, 05:14 PM
Hi Grant,

I tried to reproduce the described behavior, but on my side it works as expected. 

I am unsure of the exact reason for this issue. However, I have one suggestion - if you use a custom style - please check if without using it, you can reproduce the same behavior. If the issue is caused by the custom style, then you can send us a code snippet or a sample project, so that we can help you further. If the problem is not connected to any custom style, please provide us more information about your implementation.

I attached the test project I used to try to reproduce the issue. Please modify it in order to reproduce the described exception and send it back to us.

Thank you for your cooperation.

Regards,
Milena
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Grant
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or