In order to apply format to the labels from the second vertical axes, you can directly set the LabelFormat property to the axes in the custom renderer.
Example:
Com.Telerik.Widget.Chart.Visualization.CartesianChart.Axes.LinearAxis verticalAxisBar = new Com.Telerik.Widget.Chart.Visualization.CartesianChart.Axes.LinearAxis();
verticalAxisBar.HorizontalLocation = Com.Telerik.Widget.Chart.Engine.Axes.Common.AxisHorizontalLocation.Right; // set label format to the vertical axesverticalAxisBar.LabelFormat = "";
I would like to ask you to open a support ticket/forum thread for future questions you may have. Please note that this public feedback item is a feature request about providing support for Multiple Axes. It is not related to the axes labels and label formats.
Regards,
Didi
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/.
Indeed, the kb article shows the general approach. Other than that, if you have concrete charts that need a secondary axis, you can create a custom class that inherits from RadCartesianChart and use it as a target type in the renderer:
In this way the renderer will not be applied to all Charts in the app.
Another approach is in the renderer inside OnElementChanged event to check the series data - through the this.Control references you have access to the series and the axes of the chart.
Please try these and let me know if you have any additional questions or concerns.
Regards,
Yana
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/.
santhosh
Posted on:01 Feb 2021 08:05
Thank you for the quick response & solution I have another query about how to handle the situation like the CustomChartRenderedrequired the secondary Y-Axis case & not required the secondary Y-axis case using one CustomChartRendered. In your example without checking the secondary Y-axis required or not all the time directly added an example Add AddeSecondaryVerticalAxis(series[1]) in the method OnElementChanged().
publicclassCustomChartRenderer:Telerik.XamarinForms.ChartRenderer.Android.CartesianChartRenderer{publicCustomChartRenderer(Context context):base(context){}protectedoverridevoidOnElementChanged(Xamarin.Forms.Platform.Android.ElementChangedEventArgs<Telerik.XamarinForms.Chart.RadCartesianChart> e){base.OnElementChanged(e);var series =this.Control.Series.ToArray();AddSecondaryHorizontalAxis(series[1]);AddSecondaryVerticalAxis(series[1]);}privatevoidAddSecondaryVerticalAxis(Java.Lang.Object lineSeries){if(lineSeries isCom.Telerik.Widget.Chart.Visualization.CartesianChart.Series.Categorical.LineSeries){var series = lineSeries asCom.Telerik.Widget.Chart.Visualization.CartesianChart.Series.Categorical.LineSeries;Com.Telerik.Widget.Chart.Visualization.CartesianChart.Axes.LinearAxis verticalAxisBar =newCom.Telerik.Widget.Chart.Visualization.CartesianChart.Axes.LinearAxis();
verticalAxisBar.HorizontalLocation=Com.Telerik.Widget.Chart.Engine.Axes.Common.AxisHorizontalLocation.Right;
series.VerticalAxis= verticalAxisBar;}}privatevoidAddSecondaryHorizontalAxis(Java.Lang.Object lineSeries){if(lineSeries isCom.Telerik.Widget.Chart.Visualization.CartesianChart.Series.Categorical.LineSeries){var series = lineSeries asCom.Telerik.Widget.Chart.Visualization.CartesianChart.Series.Categorical.LineSeries;Com.Telerik.Widget.Chart.Visualization.CartesianChart.Axes.DateTimeCategoricalAxis horizontalAXis =newCom.Telerik.Widget.Chart.Visualization.CartesianChart.Axes.DateTimeCategoricalAxis();
horizontalAXis.VerticalLocation=Com.Telerik.Widget.Chart.Engine.Axes.Common.AxisVerticalLocation.Top;
series.HorizontalAxis= horizontalAXis;}}}
ADMIN
Didi
Posted on:28 Jan 2021 15:06
Hello,
Each custom renderer class is decorated with an ExportRenderer attribute that registers the renderer with Xamarin.Forms. The attribute takes two parameters – the type name of the control being rendered(in your case the (Telerik.XamarinForms.Chart.RadCartesianChart ), and the type name of the custom renderer
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/.
santhosh
Posted on:28 Jan 2021 08:05
While registering the renderer showing the error ChartAxis is not supporting in Android Example
I can assure you that we are keeping an eye on this item and track its demand. Please follow and vote for it in order to receive an email notification when there is an update.
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/.
santhosh
Posted on:21 Jan 2021 09:59
I am waiting to see the secondary Y-Axis i.e the Y-Axis on both left and right side. When can I expect this feature ? it seems it is pending from last couple of years.
ADMIN
Yana
Posted on:18 Sep 2018 07:38
Hi Craig.
Thank you for sending your comment. We have this feature request in mind and as you're following the item, you will receive an email notification as soon as there is a status change.
Craig
Posted on:23 Aug 2018 20:53
I would also like to see this in Xamarin.Forms
ADMIN
Yana
Posted on:19 Apr 2018 14:51
Hi CT,
Thank you sending your comment. We're keeping an eye on this item and if there's demand, we'll schedule it for some of the upcoming releases.
CT
Posted on:19 Apr 2018 09:47
Yeah, I am looking forward the secondary Y-Axis too.
ADMIN
Yana
Posted on:03 Apr 2018 07:02
Hi Naveen,
Thank you for your comment. At this point multiple axes feature is yet not planned for implementation. As you're following the item, you will be notified on any status changes.
Naveen
Posted on:05 Jul 2017 07:12
I am waiting to see the secondary Y-Axis i.e the Y-Axis on both let and right side.