SeriesMapping CollectionIndex not working in SL4 RC Charts

12 posts, 0 answers
  1. Schneider
    Schneider avatar
    10 posts
    Member since:
    Nov 2008

    Posted 28 Mar 2010 Link to this post

    I am binding my chart items source to ObservableCollection<DataServiceCollection<X>>   .... (DataServiceCollection is a WCF Data Services type that is based up ObservableCollection)

    When I create the SeriesMappings, if I dont specify a CollectionIndex I get a null pointer exception and errors that it cannot bind to properties of X -- which is OK because its trying to bind on DataServiceCollection because I have not set a CollectionIndex.

    If I try to do the correct thing and set CollectionIndex to 0, then when my SL application loads all I see is a white screen! I do not see the chart. I do not see any of my other GUI. I do not see any errors. I do not get any crashes. I just get nothing but a white screen. And yes the SL is loading, I can hit breakpoints.

    This is using Telerik Silverlight RC with VS2010 RC and SL4 RC

    What is going on here?
  2. Schneider
    Schneider avatar
    10 posts
    Member since:
    Nov 2008

    Posted 28 Mar 2010 Link to this post

    Wow the more I use this the more I realise what a horrible piece of code it must be!

    I have stopped using DataServiceCollection and just did a test with a manually created OC<List<X>> containing a single List.

    That works fine if there is one SeriesMapping setup.

    If I create a second (unused) series mapping then I get the white screen of death.

    If I create second List in my OC, then I see the graph but it says "No data"

    What on earth....
  3. DevCraft banner
  4. Schneider
    Schneider avatar
    10 posts
    Member since:
    Nov 2008

    Posted 29 Mar 2010 Link to this post

    It appears that the chart shits itself if you DARE to create a SeriesMapping before there is a collection at the CollectionIndex,

    And conversely if you remove a collection from the ItemSource BEFORE you remove the SeriesMapping for the collection... it shits itself.

    Yay that means lots of complicated code to write. Thanks.

    Any chance you could fix this to make it remotely sensible?
  5. Schneider
    Schneider avatar
    10 posts
    Member since:
    Nov 2008

    Posted 30 Mar 2010 Link to this post

    Heres a hint:

    The chart should not crash just because one of the collections is empty.

    It does.
  6. Schneider
    Schneider avatar
    10 posts
    Member since:
    Nov 2008

    Posted 30 Mar 2010 Link to this post

    Basically as it stands there is no way to build a chart with dynamic ItemsSource and SeriesMappings without writing some extremely complicated code.

    Heres the facts:

    - Exception if a collection in itemssource has no items
    - Exception if collection removed from items source before series mapping removed
    - White screen if collection added to itemssource without first adding series mapping

    This turns something that should be so easy, into a total nightmare.

    This scenario cannot possibly have been tested, and its not an unusual scenario (wanting to add/remove series from a graph)
  7. Schneider
    Schneider avatar
    10 posts
    Member since:
    Nov 2008

    Posted 30 Mar 2010 Link to this post

    Not to mention the fact that using an index for the collection bindings is dumb.

    What happens when any collections are added or removed? Yes the indexes become invalid (it will crash of course) so you have to spend a lot of effort keeping them synchronized. Not to mention the exceptions i have already discussed above which multiply this complexity! In fact at this point you really have to consider ditching this product.

    Pain....full
  8. Schneider
    Schneider avatar
    10 posts
    Member since:
    Nov 2008

    Posted 31 Mar 2010 Link to this post

    News update:

    Additional Y axis does not seem to work either.

    As usual you have to be very careful not to make any changes to the Axis at the wrong times or it crashes with this stack trace:

      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.Axis2D<Telerik.Windows.Controls.Charting.AxisYItem2D>.UpdateSlider(string propertyName = "AxisSliderSmallChange") + 0x13a bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.Axis2D<Telerik.Windows.Controls.Charting.AxisYItem2D>.ZoomScrollSettings_PropertyChanged(object sender = {Telerik.Windows.Controls.Charting.ZoomScrollSettings}, System.ComponentModel.PropertyChangedEventArgs e = {System.ComponentModel.PropertyChangedEventArgs}) + 0x3d bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.ZoomScrollSettings.OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e = {System.ComponentModel.PropertyChangedEventArgs}) + 0x41 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.ZoomScrollSettings.OnPropertyChanged(string propertyName = "AxisSliderSmallChange") + 0x4c bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.ZoomScrollSettings.AxisSliderSmallChange.set(double value = 0.10000000000000003) + 0x41 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.Axis.UpdateAxisSliderChangeSteps() + 0x123 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.Axis.BuildAxisData() + 0x1f6 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.Axis.UpdateAxis() + 0x5d bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.Axis.ChartAreaDataChanged(object sender = {Telerik.Windows.Controls.Charting.ChartArea}, System.EventArgs e = {System.EventArgs}) + 0x22 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.ChartArea.OnDataChanged() + 0x48 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.ChartArea.UpdateChart() + 0xb8 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesCollectionChanged(object sender = Count = 1, System.Collections.Specialized.NotifyCollectionChangedEventArgs e = {System.Collections.Specialized.NotifyCollectionChangedEventArgs}) + 0x69 bytes
      System.Windows.dll!System.Collections.ObjectModel.ObservableCollection<Telerik.Windows.Controls.Charting.DataSeries>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x37 bytes
      Telerik.Windows.Data!Telerik.Windows.Data.RadObservableCollection<Telerik.Windows.Controls.Charting.DataSeries>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e = {System.Collections.Specialized.NotifyCollectionChangedEventArgs}) + 0x38 bytes
      Telerik.Windows.Data!Telerik.Windows.Data.RadObservableCollection<Telerik.Windows.Controls.Charting.DataSeries>.ResumeNotifications() + 0xbe bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection<Telerik.Windows.Controls.Charting.DataSeries>.AddRange(System.Collections.Generic.IEnumerable<Telerik.Windows.Controls.Charting.DataSeries> items = Count = 1) + 0x3d bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.RadChart.GenerateDataSeries(object originalData = Count = 2, Telerik.Windows.Controls.Charting.SeriesMappingCollection seriesMappings = Count = 1, Telerik.Windows.Controls.Charting.ChartArea chartArea = {Telerik.Windows.Controls.Charting.ChartArea}) + 0x275 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.RadChart.GenerateDataSeries(object originalData = Count = 2) + 0x1c2 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.RadChart.Rebind(object originalData = Count = 2) + 0xb7 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.RadChart.Rebind() + 0x49 bytes
      Telerik.Windows.Controls.Charting!Telerik.Windows.Controls.RadChart.NotifyCollectionChanged(object sender = Count = 1, System.Collections.Specialized.NotifyCollectionChangedEventArgs e = {System.Collections.Specialized.NotifyCollectionChangedEventArgs}) + 0x22 bytes
      System.Windows.dll!System.Collections.ObjectModel.ObservableCollection<Telerik.Windows.Controls.Charting.SeriesMapping>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e) + 0x37 bytes
      Telerik.Windows.Data!Telerik.Windows.Data.RadObservableCollection<Telerik.Windows.Controls.Charting.SeriesMapping>.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e = {System.Collections.Specialized.NotifyCollectionChangedEventArgs}) + 0x38 bytes
      System.Windows.dll!System.Collections.ObjectModel.ObservableCollection<System.__Canon>.InsertItem(int index, System.__Canon item) + 0x94 bytes
      Telerik.Windows.Data!Telerik.Windows.Data.RadObservableCollection<Telerik.Windows.Controls.Charting.SeriesMapping>.InsertItem(int index = 0, Telerik.Windows.Controls.Charting.SeriesMapping item = {Telerik.Windows.Controls.Charting.SeriesMapping}) + 0x97 bytes
      mscorlib.dll!System.Collections.ObjectModel.Collection<Telerik.Windows.Controls.Charting.SeriesMapping>.Add(Telerik.Windows.Controls.Charting.SeriesMapping item) + 0x69 bytes
    > ReportViewer!ReportViewer.MainPage.UpdateSeriesMappings() Line 63 + 0x20 bytes C#

    So I got around that by only changing the YAxis after any changes to the itemssource are made.

    Then I get another problem... once I start using the AxisName property to correlated the series to the correct Y Axis.... what it renders simple not right. Everything just goes into one flat line along the bottom of the graph - the Y Axis are labelled but have no values on them. Oh god what next....

  9. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 31 Mar 2010 Link to this post

    Hi Schneider,

    The problems with SeriesMappings you mentioned are addressed in the latest internal build (version 2010.1.326). Please, download it and give it a try.

    As for the additional Y axes -- I am afraid I could not really get the scenario that triggers this behavior. Can you please provide more details? Thanks.

    Regards,
    Ves
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Allan D. Jensen
    Allan D. Jensen avatar
    5 posts
    Member since:
    Sep 2009

    Posted 29 Apr 2010 Link to this post

    I use WPF version 2010.1.422.35, but I still have a problem to create an instance of SeriesMapping i.e. Dim seriesMapping As New SeriesMapping() . In run time I got a pop up that says: There is no source code available for the current location
  11. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 04 May 2010 Link to this post

    Hello Allan,

    I was only able to reproduce this when trying to debug the code with "Step Into (F11)" into the SeriesMapping  constructor. Still, running the code or using "Step Over (F10)" does not produce this problem.  I verified that there is no first chance exception, so please use F10 while our developers investigate the problem.

    Best regards,
    Ves
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  12. Colm
    Colm avatar
    9 posts
    Member since:
    Jul 2010

    Posted 13 Oct 2010 Link to this post

    Hi,
    I am having the same issues with the chart, namely I can't blend when the series mapping is bound as I get an exception thrown on construction. In addition, at runtime, if the seriesmapping isn't set, I get a white screen hang of silverlight.

    I'm using 2010.2.924.1040.

    Here's the error I get in Cider:
    Object reference not set to an instance of an object.
       at Telerik.Windows.Controls.RadChart.ClearDataSeries() in c:\Builds\WPF_Scrum\Release_SL_2010_Q2_SP2\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 1032
       at Telerik.Windows.Controls.RadChart.Rebind(Object originalData) in c:\Builds\WPF_Scrum\Release_SL_2010_Q2_SP2\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 1014
       at Telerik.Windows.Controls.RadChart.ItemsSourcePropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_SL_2010_Q2_SP2\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 852
       at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_SL_2010_Q2_SP2\Sources\Development\Core\Controls\Common\System.Windows\PropertyMetadata.cs:line 200
       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.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
       at Telerik.Windows.Controls.RadChart.set_ItemsSource(Object value) in c:\Builds\WPF_Scrum\Release_SL_2010_Q2_SP2\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 479
       at Telerik.Windows.Controls.RadChart.InitializeDesignTimeData() in c:\Builds\WPF_Scrum\Release_SL_2010_Q2_SP2\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 1131
       at Telerik.Windows.Controls.RadChart.OnApplyTemplate() in c:\Builds\WPF_Scrum\Release_SL_2010_Q2_SP2\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 716
       at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)


    The XAML I'm using:
    <views:RendererViewBase x:Class="Automsoft.nuaViews.Views.Renderers.ChartRenderer"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
                 xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
                 xmlns:views="clr-namespace:Automsoft.nuaViews.Views"
                 mc:Ignorable="d"
                 DataContext="{Binding ViewModelChartRenderer, Source={StaticResource Locator}}">
        <Grid x:Name="LayoutRoot">
            <views:RendererDecorator x:Name="Container">
                <views:RendererDecorator.ContentArea>
                    <telerikChart:RadChart telerik:StyleManager.Theme="Windows7"
                                           ItemsSource="{Binding Path=SeriesData, Mode=OneWay}"
                                           SeriesMappings="{Binding Path=SeriesMappings, Mode=OneWay}">
                        <telerik:RadChart.DefaultView>
                            <telerik:ChartDefaultView>
                                <telerik:ChartDefaultView.ChartTitle>
                                    <telerik:ChartTitle  FontFamily="{Binding TitleFont.FontFamily}"
                                                         FontSize="{Binding TitleFont.FontSize}"
                                                         Foreground="{Binding TitleFont.FontColor}"
                                                         FontStyle="{Binding TitleFont.FontStyle}"
                                                         FontWeight="{Binding TitleFont.FontWeight}"
                                                         Content="{Binding Title}"/>
                                </telerik:ChartDefaultView.ChartTitle>
                                <telerik:ChartDefaultView.ChartLegend>
                                    <telerik:ChartLegend/>
                                </telerik:ChartDefaultView.ChartLegend>
                                <telerik:ChartDefaultView.ChartArea>
                                    <telerik:ChartArea AdditionalYAxes="{Binding AdditionalYAxes, Mode=OneWay}">
                                        <telerik:ChartArea.AxisX>
                                            <telerik:AxisX Title="{Binding XAxisTitle}"
                                                           AutoRange="{Binding XAxisAutoScale}"
                                                           IsDateTime="{Binding XAxisIsDateTime}"
                                                           MinValue="{Binding XAxisMinimumScale}"
                                                           MaxValue="{Binding XAxisMaximumScale}"
                                                           LayoutMode="Inside"
                                                           StepLabelLevelCount="2" />
                                        </telerik:ChartArea.AxisX>
                                    </telerik:ChartArea>
                                </telerik:ChartDefaultView.ChartArea>
                            </telerik:ChartDefaultView>
                        </telerik:RadChart.DefaultView>
                    </telerikChart:RadChart>
                </views:RendererDecorator.ContentArea>
            </views:RendererDecorator>
        </Grid>
    </views:RendererViewBase>

  13. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 15 Oct 2010 Link to this post

    Hi Colm,

    I can confirm, there is an issue in this very scenario -- binding the series mappings. It has already been logged and our developers are after it, the fix will be available in the next internal build. Please, accept our apologies for the inconvenience caused.

    Best regards,
    Ves
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner