GaugeChart Ranges dynamic binding

2 Answers 62 Views
Chart
Anu
Top achievements
Rank 1
Iron
Anu asked on 29 Mar 2023, 07:50 AM
Can I render my gauge chart ranges from c# code to UI?I have to bind my ranges based on specific conditions. Finally the ranges colors should be given in xaml. How can I achieve this? 

2 Answers, 1 is accepted

Sort by
0
Darina
Telerik team
answered on 29 Mar 2023, 08:42 AM

Hi Anu,

Thank you for reaching out to us.

Please be advised that product representative will contact you and will be able to assist with your inquiry.

Regards, Darina Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Anu
Top achievements
Rank 1
Iron
commented on 29 Mar 2023, 08:44 AM

Thank you
0
Lance | Manager Technical Support
Telerik team
answered on 29 Mar 2023, 06:32 PM

Hello Anu,

You will find instructions on how to achieve this in the following documentation => Xamarin Chart Documentation | Custom Chart Palette - Telerik UI for Xamarin

Note 1

You can switch between XAML and C# for the code sample blocks by using the little tabs at the top left.

Note 2

If you want to define your color palettes in XAML and use them in C#, you need to reference those resources via their StaticResource x:Key. 

For example, if you has an instance of 'MyThing' in the page resources and it has a key value of 'Thing1'

<ContentPage>
    <ContentPage.Resources>
        <MyThing x:Key="Thing1" />
    </ContentPage.Resources>

 ... page stuff here
</ContentPage>

you can get a reference to it in C# using the key and cast it to the object type:

MyThing thingToUseInCode = this.Resources["Thing1"] as MyThing;

Please understand this is not something special for Telerik, it is the same for any XAML-defined resource.

Regards,
Lance | Manager Technical Support
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Chart
Asked by
Anu
Top achievements
Rank 1
Iron
Answers by
Darina
Telerik team
Lance | Manager Technical Support
Telerik team
Share this question
or