RadCartesianChart LineSeries problem

6 posts, 0 answers
  1. Davor
    Davor avatar
    5 posts
    Member since:
    Oct 2014

    Posted 03 Nov 2014 Link to this post

    Hello,
    I am using RadCartesianChart for my project and I need to show the data I have with Line Series.
    I am able to show it with BarSeries, but I cannot do the same with LineSeries.
    This is my code for the data binding

    <telerik:RadCartesianChart.Series>
        <telerik:BarSeries CategoryBinding="date" ValueBinding="value" ItemsSource="{Binding}">
        </telerik:BarSeries>
    </telerik:RadCartesianChart.Series>

    However, when I use the following code
    <telerik:RadCartesianChart.Series>
        <telerik:LineSeries CategoryBinding="date" ValueBinding="value" ItemsSource="{Binding}">
        </telerik:LineSeries>
    </telerik:RadCartesianChart.Series>

    it gives me the error:
    Error 1 Ambiguous type reference. A type named 'LineSeries' occurs in at least two namespaces, 'Telerik.Windows.Controls.ChartView' and 'Telerik.Windows.Controls.Charting'. Consider adjusting the assembly XmlnsDefinition attributes. C:\Users\.......

    And in Window I only have this:
    <Window ...
    .... 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    ... />

    How do I fix this? 


  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 04 Nov 2014 Link to this post

    Hello Davor,

    There is a class named LineSeries in the Charting assembly and there is another LineSeries class in the Chart assembly. You get the ambiguity error because both of these classes are mapped to the telerik schema. So when you write telerik:LineSeries, the xaml parser does not know which class you mean.

    There is more than one way to sort this out, but we recommend that you fully remove the old Charting assembly and do not use the old RadChart at all. The new ChartView (in the Chart.dll) is much faster, it is very easy to set up and is also very flexible. It also resolves many of the limitations that the old control had.

    I hope that you will be able to completely remove the Charting.dll reference from your project, and this error will be eliminated.

    Regards,
    Petar Marchev
    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Davor
    Davor avatar
    5 posts
    Member since:
    Oct 2014

    Posted 04 Nov 2014 in reply to Petar Marchev Link to this post

    Thanks. Removing the Charting.dll didn't influence a lot on my project, so I managed to get things working quite fast. Thanks a lot, it works perfectly.
  5. Erhan
    Erhan avatar
    15 posts
    Member since:
    Dec 2014

    Posted 06 Jan 2015 in reply to Petar Marchev Link to this post

    There are any soluting without removing charting? Because ı need charting in my a lot of view . I removed charting and try to work just with chart . My old Radchart and something more have error.
  6. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 07 Jan 2015 Link to this post

    Hello Erhan,

    As explained before, the problem is that when you write telerik:LineSeries the xaml parser does not know which of the two LineSeries classes you mean. You can avoid this by simply not using the telerik: schema, you can directly use the namespaces you require:
    xmlns:chartView="clr-namespace:Telerik.Windows.Controls.ChartView;assembly=Telerik.Windows.Controls.Chart"
     
    xmlns:oldChart="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"

    <chartView:LineSeries />
    <oldChart:LineSeries />

    Now the ambiguity should be resolved.

    Regards,
    Petar Marchev
    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.

     
  7. Erhan
    Erhan avatar
    15 posts
    Member since:
    Dec 2014

    Posted 02 Feb 2015 in reply to Petar Marchev Link to this post

    Thanks So Much.
Back to Top
UI for WPF is Visual Studio 2017 Ready