Telerik Forums
UI for Xamarin Forum
4 answers
140 views

 Hello everyone, for now I need create a bar chart like the image I have attached in a short time and I believe telerik will be the best solution for it. But unfortunately, after take a look in the document and try to implement a sample , I still cannot make it work , here is my code and I still have no idea what's wrong with them . Please help , thank you so much :)

 The problems are:
1/Cannot change the fill color of the bar

2/ Cannot add the the vertical line behind for each chart column

3/I wonder If we can make the chart columt half-round like the design ? (It means that round in the head of column and flat in the tail)

4/Gradient color for chart column

var chart = new RadCartesianChartView(this);

var customPalette = new ChartPalette(chart.Palette);

var barEntry = customPalette.GetEntry(ChartPalette.BarFamily);
barEntry.Fill = Color.Rgb(68, 163, 122);
barEntry.AdditionalFill = Color.Rgb(118, 195, 169);
barEntry.Stroke = 0;
chart.Palette = customPalette;

var verticalAxis = new LinearAxis();
var horizontalAxis = new CategoricalAxis
{
LabelFormat = "%.0f"
};
var barSeries = new BarSeries
{
ValueBinding = new ValueBinding(),
CategoryBinding = new CategoryBinding(),
VerticalAxis = verticalAxis,
HorizontalAxis = horizontalAxis,
MaxBarWidth = 10,
AreBarsRounded = true,
RoundBarsRadius = 5,
Data = getData()
};
var grid = new CartesianChartGrid();
grid.MajorXLinesRenderMode = GridLineRenderMode.All;
grid.LineThickness = 5;
grid.LineColor = Color.Red;
grid.MajorLinesVisibility = GridLineVisibility.X;
chart.Grid = grid;

chart.Grid.CanApplyPalette = true;
chart.Series.Add(barSeries);
barSeries.UpdatePalette(true);

Lâm
Top achievements
Rank 2
 answered on 14 May 2017
1 answer
86 views

OK soo no one shoot me over this question.  

I have never created a Xamarian project, but am tryign to get everything straight in my head before i start down a path.

 

But what is the difference in purchasing/using   Xamarian.Forms   or     Xamarian for Android UI?

Is Xamarian for Android the exact same thing only it wont "port" over to iOS/Windows?

 

Or is it more like Xamarian for Android is used in the Android platform specific folder (forget what Xamarian calls it), and Xamarian.Forms is in the Shard project folder?

 

Stefan Nenchev
Telerik team
 answered on 12 May 2017
4 answers
228 views
In the Xamarin Forms ListView you can have different types of cells in the same ListView. Is it possible to do that with RadListView, and if so, how?
Ron
Top achievements
Rank 1
 answered on 11 May 2017
2 answers
80 views

Hi,

it looks as if the sidedrawer opens unexpectedly, when there is a simple entry field in the main content.

Please have a look at this sample ( i copied it from the SDKBrowser samples and added just the entry field):

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns:telerikPrimitives="clr-namespace:Telerik.XamarinForms.Primitives;assembly=Telerik.XamarinForms.Primitives" xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Portable.SDTest">
    <!-- >> sidedrawer-gettingstarted-xaml -->
    <telerikPrimitives:RadSideDrawer x:Name="drawer" DrawerLength="200">
        <telerikPrimitives:RadSideDrawer.MainContent>
            <StackLayout>
            <Label Text="Main content" />
                <Entry Placeholder="Enter some text + press ENTER" />
            </StackLayout>
        </telerikPrimitives:RadSideDrawer.MainContent>
        <telerikPrimitives:RadSideDrawer.DrawerContent>
            <StackLayout>
                <Button Text="Mail" />
                <Button Text="Calendar" />
                <Button Text="People" />
                <Button Text="Tasks" />
            </StackLayout>
        </telerikPrimitives:RadSideDrawer.DrawerContent>
    </telerikPrimitives:RadSideDrawer>
    <!-- << sidedrawer-gettingstarted-xaml -->
</ContentPage>

The codebehind file is empty:

namespace Portable
{
    public partial class SDTest : ContentPage
    {
        public SDTest()
        {
            InitializeComponent();
        }
    }
}

 

When you test this page you will see, that the drawer opens after press ENTER in the entry field.

Can you explain why this is happening? It would be great to find a workarround because this is very annoying for the user.

Best regards,

Frank Fink

frank
Top achievements
Rank 1
 answered on 11 May 2017
2 answers
230 views

I want to change the color or remove the green underline of this control in Android, any way to do this? I can't see any information about this in the documentation. I think i need to do a custom render but i don't know what property i need to change.

 

Regards.

Francisco Gabriel
Top achievements
Rank 1
 answered on 11 May 2017
3 answers
172 views

Good evening,

I am trying to get working date fields and the "third party source" (no decorations) way to generate a dataform but I just can't figure out how to solve this. I have read the documentation about the dataform and made some tests to adapt the code e.g. for the custom string DateTime converter.

I took the Telerik example in \Examples\XamarinForms\SDKBrowser\SDKBrowser\Examples\DataForm\DataFormCustomSource.xaml as a base and added a "Date" field inside the source dictionary.
I registered the date editor for the field after setting the source and also set some metadata for the field (a custom string DateTime converter, the DateRangeValidatorAttribute validator and the NativeConversionContext = DateTimeKind.Utc) but the code crashes before displaying the dataform. There is no other code changes.

How is it possible to achieve this?

When I load the data form, the debugger goes through the converter Convert method without problem before crashing. Here is the Exception I have:

Java.Lang.Error: DataFormDateEditor does not support properties of type String. Please specify a value converter for your property. ---> Java.Lang.ClassCastException: java.util.GregorianCalendar cannot be cast to java.lang.Number
   --- End of inner exception stack trace ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/4009/3a62f1ea/source/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00084] in /Users/builder/data/lanes/4009/3a62f1ea/source/Java.Interop/src/Java.Interop/Java.Interop/JniEnvironment.g.cs:11643
  at Android.Runtime.JNIEnv.CallVoidMethod (System.IntPtr jobject, System.IntPtr jmethod, Android.Runtime.JValue* parms) [0x00000] in /Users/builder/data/lanes/4009/3a62f1ea/source/monodroid/src/Mono.Android/JNIEnv.g.cs:264
  at Com.Telerik.Widget.Dataform.Visualization.RadDataForm.set_Entity (Com.Telerik.Widget.Dataform.Engine.IEntity value) [0x00067] in <ae3a3c051b4c45cab0d27f8036263c89>:0
  at Telerik.XamarinForms.InputRenderer.Android.DataFormAdapter.UpdateEntity (Telerik.XamarinForms.Input.RadDataForm sourceOwner, Com.Telerik.Widget.Dataform.Visualization.RadDataForm targetOwner) [0x0003a] in <baeb1b2081654501888ace4ddb013183>:0
  at Telerik.XamarinForms.InputRenderer.Android.DataFormAdapter.UpdateCore (Telerik.XamarinForms.Input.RadDataForm sourceOwner, Com.Telerik.Widget.Dataform.Visualization.RadDataForm targetOwner, System.String propertyName) [0x0001d] in <baeb1b2081654501888ace4ddb013183>:0
  at Telerik.XamarinForms.Common.FacadeAdapterBase`2[S,T].Update (System.Object sourceOwner, System.Object targetOwner, System.String propertyName, System.Object sourceOwnerRoot, System.Object targetOwnerRoot) [0x00000] in <b09df7d4d5e74454b9482f9e64875b96>:0
  at Telerik.XamarinForms.Common.XamarinToNativeControlExtensions.Update[T,K] (T nativeElement, K xfЕlement, System.String propertyName, System.Object sourceOwnerRoot, System.Object targetOwnerRoot) [0x0002b] in <b09df7d4d5e74454b9482f9e64875b96>:0
  at Telerik.XamarinForms.InputRenderer.Android.DataFormRenderer.OnElementAttached (Telerik.XamarinForms.Input.RadDataForm newElement) [0x00032] in <baeb1b2081654501888ace4ddb013183>:0
  at Telerik.XamarinForms.Common.Android.AndroidRendererBase`2[S,T].OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x00037] in <abbc9cd0d37b4c7ca6ff11fd056edf7f>:0
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x000f4] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:196
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Platform.cs:289
  at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement view, Xamarin.Forms.Platform.Android.IVisualElementRenderer oldRenderer, Xamarin.Forms.Platform.Android.RendererPool pool, System.Boolean sameChildren) [0x00023] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:84
  at Xamarin.Forms.Platform.Android.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement, Xamarin.Forms.VisualElement newElement) [0x00104] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:217
  at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementPackager.cs:68
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager packager) [0x00007] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:335
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (TElement element) [0x00111] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:199
  at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:137
  at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element, Android.Support.V4.App.FragmentManager fragmentManager) [0x00031] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Platform.cs:325
  at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState) [0x00008] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\FragmentContainer.cs:67
  at Android.Support.V4.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_inflater, System.IntPtr native_container, System.IntPtr native_savedInstanceState) [0x00022] in <27c17fe440cf491ba8255bcefade6e02>:0
  at (wrapper dynamic-method) System.Object:8b7a6b9b-c5f7-4699-a0b0-ed94f89278f8 (intptr,intptr,intptr,intptr,intptr)
  --- End of managed Java.Lang.Error stack trace ---

Information:
OS: Win10 Pro 64bits 1511
Visual Studio 2015 Community: 14.25431.01 Update 3
Telerik: 2017.1.10321.10
Xamarin: 2.3.4.231
PCL: profile 111

Thanks!

Greg
Ivaylo Gergov
Telerik team
 answered on 11 May 2017
1 answer
143 views
Does your ListView support a jump list the same as the Xamarin Forms ListView does via its GroupShortNameBinding property?
Tsvyatko
Telerik team
 answered on 10 May 2017
1 answer
95 views
Will you be able to use linear gauges in xamarin android from the library Telerik.Xamarin.Android.Gauges.dll (2017.2.503.0)?
Nikolay
Telerik team
 answered on 10 May 2017
1 answer
112 views

Whenever I add a RadHorizontalGauge to a container element, it only takes up about 85% of the horizontal space.  Is there any way of making it take up the full width of the container?  I have a gauge in a StackLayout, and I want the gauge to take up the max available width - here is my XAML...

<StackLayout BackgroundColor="#ff0000" Padding="10,10,10,0" Spacing="0" VerticalOptions="Start">
    <telerikGauges:RadHorizontalGauge x:Name="profileProgressGauge">
        <telerikGauges:RadGaugeBase.Axis>
            <telerikGauges:GaugeLinearAxis Minimum="0" Maximum="100" Step="5" ShowLabels="False" StrokeThickness="0" />
        </telerikGauges:RadGaugeBase.Axis>
        <telerikGauges:RadGaugeBase.Indicators>
            <telerikGauges:GaugeBarIndicator Value="100" Fill="#ffffff" Position="End" StartCap="Oval" EndCap="Oval" />
            <telerikGauges:GaugeBarIndicator Value="40" Fill="#73d016" Position="End" StartCap="Oval" EndCap="Oval" />
        </telerikGauges:RadGaugeBase.Indicators>
    </telerikGauges:RadHorizontalGauge>
</StackLayout>

 

If you look at the first attached picture (the output of the XAML above), the gauge seems to occupy only 85-90% of the available width.  If you look at second attached picture, taken from the latest Progress Telerik UI for Xamarin sample app in the AppStore/GooglePlay, you'll see the same thing - the horizontal gauge doesn't appear to take up all the available horizontal space.

Is this a bug?

Nikolay Demirev
Telerik team
 answered on 10 May 2017
1 answer
102 views

I have this custom render. I want to define the source elements of the AutoComplete but i can't see any info in the documentation for iOS.

 

Regards.

 

protected override Type GetCustomEditorType(string propertyName, Type propertyType)
        {
            switch (propertyName)
            {
 
                case nameof(AsuntosDataFormModel.tipo):
                    return typeof(TKDataFormAutoCompleteInlineEditor);
 
                default:
                    return base.GetCustomEditorType(propertyName, propertyType);
            }
        }
 
protected override void InitEditor(TKDataFormEditor editor, IEntityProperty property)
        {
            base.InitEditor(editor, property);
 
            var name = property.PropertyName;
 
            switch (name)
            {
 
                case nameof(AsuntosDataFormModel.tipo):
                    editor.Property.Image = new UIImage("ic_data_tipo.png");
                    break;
 
 
            }
        }
Ivaylo Gergov
Telerik team
 answered on 09 May 2017
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?