I have a cartesian chart with a numerical vertical axis and categorical horizontal axis.
When the data that's feeding the chart series contains only one category, the category label appears squished on iOS. The same chart renders fine on Android. See the attached screenshots.
I suspect this is a bug and should hopefully be fixed. In the mean time, any suggestions on whether it is possible to work around this, perhaps via a custom renderer?
Here's the code to recreate this:
XAML
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
ContentPage
xmlns
=
"http://xamarin.com/schemas/2014/forms"
xmlns:telerikChart
=
"clr-namespace:Telerik.XamarinForms.Chart;assembly=Telerik.XamarinForms.Chart"
xmlns:local
=
"clr-namespace:ChartBug"
x:Class
=
"ChartBug.ChartPage"
>
<
ContentPage.BindingContext
>
<
local:CategoricalViewModel
/>
</
ContentPage.BindingContext
>
<
Grid
>
<
telerikChart:RadCartesianChart
>
<
telerikChart:RadCartesianChart.HorizontalAxis
>
<
telerikChart:CategoricalAxis
ShowLabels
=
"True"
/>
</
telerikChart:RadCartesianChart.HorizontalAxis
>
<
telerikChart:RadCartesianChart.VerticalAxis
>
<
telerikChart:NumericalAxis
Minimum
=
"0"
MajorStep
=
"1"
Maximum
=
"3"
ShowLabels
=
"True"
/>
</
telerikChart:RadCartesianChart.VerticalAxis
>
<
telerikChart:RadCartesianChart.Series
>
<
telerikChart:LineSeries
ItemsSource
=
"{Binding CategoricalData}"
ShowLabels
=
"True"
>
<
telerikChart:LineSeries.ValueBinding
>
<
telerikChart:PropertyNameDataPointBinding
PropertyName
=
"Value"
/>
</
telerikChart:LineSeries.ValueBinding
>
<
telerikChart:LineSeries.CategoryBinding
>
<
telerikChart:PropertyNameDataPointBinding
PropertyName
=
"Category"
/>
</
telerikChart:LineSeries.CategoryBinding
>
<
telerikChart:LineSeries.LabelBinding
>
<
telerikChart:PropertyNameDataPointBinding
PropertyName
=
"Value"
/>
</
telerikChart:LineSeries.LabelBinding
>
</
telerikChart:LineSeries
>
</
telerikChart:RadCartesianChart.Series
>
</
telerikChart:RadCartesianChart
>
</
Grid
>
</
ContentPage
>
Code behind
using System.Collections.ObjectModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace ChartBug
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ChartPage : ContentPage
{
public ChartPage()
{
InitializeComponent();
}
}
public class CategoricalData
{
public object Category { get; set; }
public double Value { get; set; }
}
public class CategoricalViewModel
{
public CategoricalViewModel()
{
}
public ObservableCollection<
CategoricalData
> CategoricalData { get; set; } = new ObservableCollection<
CategoricalData
>
{
new CategoricalData { Category = "One", Value = 1 },
// new CategoricalData { Category = "Two", Value = 2 }
};
}
}
Just uncomment the second category as needed.
After expanding a parent TreeView item, the arrows of subitems are misplaced. The arrow is not centered anymore, although the ExpandCollapseIndicator VerticalTextAlignment stands on Center. After expanding the subitem the arrow jumps to center again.
Tested in Android emulator with Android 8.1 and real Samsung Galaxy Tab SM-T580 with Android 7.0.
Replicable on Telerik sample application:
Xamarin Forms UI sample application -> QSF -> Examples -> TreeView (see attached files)
The (example) test in the sample application is as follows:
collapse France
collapse Europe
expand Europe
collapse Europe
expand Europe
France arrow is misplaced -> too far left
expand France -> arrow jumpes to center again
regards,
Martin
It seems that the control doesn't work with Xamarin.Forms 3.2.0.
If you try when the first xaml file that uses the contronl loads you have this cryptic error:
Unhandled Exception: System.TypeLoadException: Could not resolve type with token...
To test just create a default Xamarin.Forms app and update Forms to 3.2.0. ...
Could you please check?
I have a form with a field that contains predefined options, however some of these options are not valid when another field in the form has certain data. Eg, I don't want to give the user the option to set their occupation as retired, when their age is below 30.
Following the documentation, I thought this would be possible by querying the form data source within the PropertyDataSourceProvider's GetSourceForKey method. While this works initially, it doesn't get called again until the form is manually reloaded.
My question is, is there a means to recalculate the options available for a field when data is committed back to the form's data source, or when validation is run?
Calling Reload on the form would probably do the job, but seems like overkill, and isn't very performant.
Validating the field based on the form data is another option, but this is pretty rubbish UX - why give the user the option to choose an item if it is instantly marked as invalid when chosen?
Hi,
How can I place the styling of DataGridColumnHeaderStyle and other styles in the data grid into resources, wheter that being in app.xaml ressources or in css.
What is best practice ?. Can I see some examples of this ?.
Hi there,
I am evaluating the Telerik Xamarin controls for our project. This is the first time i am working with Telerik Xamarin controls. Basically, the first demo i need to make is a simple iOS app with TreeView (DataBinding) as navigation menu, for each node click in the TreeView menu, it opens a content page for editing (save and cancel). I tried to download and rebuild the tagit sample code package, unfortunately there were a lot of build errors which i don't know how to fix them. Could you guys help me out to make a simple example for me?
Regards
Hello,
I'm already testing Xamarin UI Trial with looking forward to buy it. Is there a way to implement a highlighting of a TreeView Item on selection / tap and to set the selected TreeView Item programmatically / with databinding? With highlighting I for instance mean setting a blue background color to the item. I also need to know when an TreeView Item is selected, but therefore I found the event "ItemTapped" on RadTreeView, right?
Thank you,
regards Martin
Not sure what I'm doing wrong. I have a SlideView and hooked up the SlidedToIndex event.
public void Handle_SlidedToIndex(object sender, Telerik.XamarinForms.Primitives.SlideView.SlideViewSlidedToIndexEventArgs e) {
System.Diagnostics.Debug.WriteLine("******************** SegmentSliding Index " + e.Index + " *********************");
}
This works fine, if I add a MessagingCenter.Send to it, I ended up in an endless loop.
public void Handle_SlidedToIndex(object sender, Telerik.XamarinForms.Primitives.SlideView.SlideViewSlidedToIndexEventArgs e) {
System.Diagnostics.Debug.WriteLine("******************** SegmentSliding Index " + e.Index + " *********************"); MessagingCenter.Send(new UserInterfaceTaskMessage { InterfaceTask = "SegmentChanged", Message = selectedIndex.ToString() }, "UserInterfaceTaskMessage");
My MessageCenter has a subscribe that I'm not doing anything with yet... no code.. Just trying to report back to the view model that the index changed so that I can clear another control.
Any help would be great...
This is possibly related to the fix for OnSelectTemplate does not get called for each item in ItemsSource?
I have a slide view with four pages, different templates for each page. On iOS I observed the following:
- if I use the navigation buttons all is good, the proper slide template is selected and the indicators are properly updated to reflect the selected slide index.
- if I start the app again to re-initialize the slide view and instead swipe from the first slide to the second, the second template is used, but the indicator stays positioned on the first page. See the attached screenshot. If I swipe again to the right the second template is used again and the indicator is finally showing the second page is selected. After this I can swipe left and right and all is good.
I tried this both in the simulator and on device using the latest Xamarin Forms and Telerik components
I suspect it's a small bug on iOS. I did not notice this on Android.
Could you please confirm and fix? Thank you.
Hello,
I'm just about to replace my settings page with the DataForm. Unfortunately, I can not find an EditorType for a password! In the online documentation I find only one tip for iOS - but I need a tip (code) for Xamarin Forms.
Thanks in advance
Andreas