This is a migrated thread and some comments may be shown as answers.
RadLegend is not working with RadCartesianChart
1 Answer 24 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Hady asked on 31 Oct 2018, 03:41 PM

I tried to build a code sample with RadLegend but it throws an exception. i attached my code sample 


{Com.Telerik.Android.Common.Exceptions.MissingLayoutPartException: Layout part with id com.companyname.TelerikChart:id/notification_background is missing from the specified layout.  at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <034d4a9852dd45bea9353cc7776c99f0>:0   at Java.Interop.JniPeerMembers+JniInstanceMethods.FinishCreateInstance (System.String constructorSignature, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0004f] in <034d4a9852dd45bea9353cc7776c99f0>:0   at Com.Telerik.Widget.Primitives.Legend.RadLegendView..ctor (Android.Content.Context p0) [0x0007a] in <3df33cbb9c2a44bbb60084f618a2993d>:0   at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <43dbbdc147f2482093d8409abb04c233>:0   --- End of managed Com.Telerik.Android.Common.Exceptions.MissingLayoutPartException stack trace Layout part with id com.companyname.TelerikChart:id/notification_background is missing from the specified layout. at at at com.telerik.widget.primitives.legend.RadLegendView.<init>( at com.telerik.widget.primitives.legend.RadLegendView.<init>( at md573f120baf816a4fba7033ee5f3e60d3f.MainActivity.n_onCreate(Native Method) at md573f120baf816a4fba7033ee5f3e60d3f.MainActivity.onCreate( at at at at at at Source:0) at$H.handleMessage( at android.os.Handler.dispatchMessage( at android.os.Looper.loop( at at java.lang.reflect.Method.invoke(Native Method) at$ at}


Xaml code is

    <telerikChart:RadCartesianChart x:Name="chart" BackgroundColor="Transparent">
            <telerikChart:LineSeries CategoryBinding="Category" ValueBinding="Value" ItemsSource="{Binding CategoricalData}" DisplayName="Speed (mph) vs Time" />
            <telerikChart:CartesianChartGrid MajorLinesVisibility="XY" MajorLineThickness="1"/>
    <telerikChart:RadLegend LegendItemFontColor="White"
                            LegendProvider="{x:Reference Name=chart}" />

ViewModel code is

    public class CategoricalData
        public object Category { get; set; }
        public double Value { get; set; }

    public class CategoricalViewModel
        private static Random random = new Random();
        private static string[] categories = new string[] { "Greenings", "Perfecto", "NearBy", "Family", "Fresh" };

        public CategoricalViewModel()
            this.CategoricalData = GetCategoricalData();

        public ObservableCollection<CategoricalData> CategoricalData { get; set; }

        public static ObservableCollection<CategoricalData> GetCategoricalData()
            var data = new ObservableCollection<CategoricalData>();
            for (int i = 0; i < categories.Length; i++)
                data.Add(new CategoricalData() { Value = random.Next(50, 100), Category = categories[i] });

            return data;



1 Answer, 1 is accepted

Sort by
Lance | Manager Technical Support
Telerik team
answered on 31 Oct 2018, 05:38 PM
Hi Hady,

I wanted to also follow up in this forum thread to share my results with the rest of the community.

The demo we reviewed in our Support Ticket was missing the dependencies for the target platform projects. In your project's case, the NuGet package "Telerik.UI.for.Xamarin" should be installed to every project.

In other cases where you're not using the NuGet package, you'll need to manually reference the assemblies in each project. You can find the necessary references in the Getting Started: Required Telerik Assemblies article.

For your convenience, here's the list:

Platform Assemblies
Portable Telerik.XamarinForms.Common.dll
Android Telerik.Xamarin.Android.Common.dll
iOS Telerik.Xamarin.iOS.dll
UWP Telerik.Core.dll

I hope I was able to help clear things up.

Lance | Tech Support Engineer, Sr.
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
Asked by
Top achievements
Rank 2
Answers by
Lance | Manager Technical Support
Telerik team
Share this question