This is a migrated thread and some comments may be shown as answers.
Adjusting the width of BarSeries
1 Answer 29 Views
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 18 Sep 2015, 04:36 PM

I have been creating a Dashboard so show traffic at each minute.

On our largest time scale (4 hours) the BarSeries will overlap each other (There being a max of 240 points).

I haven't found anything in the Xamarin.Forms or Xamarin.Android documentation indicating this can be changed.

 

I am guessing that I am going to have to make a custom Chart Renderer, but I haven't explored that route yet as I am still learning the lay of the land to mobile developing.

 

Will a  custom Chart Renderer work? Is it my only option? Or is there already support for this feature?

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 23 Sep 2015, 01:08 PM
Hi Jonathan,

DateTimeContinuousAxis exposes APIs (MajorStep and MajorStepUnit properties), which should allow you to achieve the desired result, but I am afraid due to a bug, they will not be functional at the moment. The workaround would be to implement a custom renderer. In this case, it would be a simple one:


public class MyChartRenderer : CartesianChartRenderer
{
    protected override void OnElementChanged(ElementChangedEventArgs<Telerik.XamarinForms.Chart.RadCartesianChart> e)
    {
        base.OnElementChanged(e);
        DateTimeContinuousAxis axis = this.Control.HorizontalAxis as DateTimeContinuousAxis;
        axis.MajorStep = 1;
        axis.MajorStepUnit = TimeInterval.Minute;
 
    }
}

You will also need to register it, using the ExportRenderer attribute:
[assembly: ExportRenderer(typeof(Telerik.XamarinForms.Chart.RadCartesianChart), typeof(MyChartRenderer))]


Best regards,
Ves
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
Tags
Chart
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or