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

RadCartesianChart LineSeries problem

5 Answers 566 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Davor
Top achievements
Rank 1
Davor asked on 03 Nov 2014, 12:11 PM
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? 


5 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 04 Nov 2014, 02:50 PM
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.

 
0
Davor
Top achievements
Rank 1
answered on 04 Nov 2014, 03:49 PM
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.
0
Erhan
Top achievements
Rank 1
answered on 06 Jan 2015, 09:56 AM
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.
0
Petar Marchev
Telerik team
answered on 07 Jan 2015, 01:58 PM
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.

 
0
Erhan
Top achievements
Rank 1
answered on 02 Feb 2015, 09:24 PM
Thanks So Much.
Tags
Chart
Asked by
Davor
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Davor
Top achievements
Rank 1
Erhan
Top achievements
Rank 1
Share this question
or