DateTimeCategoricalAxis

6 posts, 0 answers
  1. Itamar
    Itamar avatar
    31 posts
    Member since:
    Mar 2016

    Posted 06 Mar Link to this post

    Hello

    We working with the chart in xamarin android 
    The horizontal axis is  DateTimeCategoricalAxis
    DateTimeComponent = DateTimeComponent.TimeInMillis
    LabelFormat = "HH:mm"
    LabelFitMode = AxisLabelFitMode.None,


    ShowLine=false,
    I have some questions:
    1.How to hide the ticks
    2.When the LabelLayoutMode = AxisLabelLayoutMode.Inner in the vertical axis
    There is gap from the left (look in the attached file)
    3.I can’t change the label format in the horizontal axis it not working 
    4.When the grid adds to the view it fills parent width after I add the series the width is 
    Change the there is gap from the right (look in the attached file)

    the desired result from the horizontal axis label format is in the attached file 

    i cant do this my data is to big and i have 5 deferent series 

    public class Converter : Java.Lang.Object, IFunction
        {
            public Java.Lang.Object Apply(Java.Lang.Object p0)
            {
                MajorTickModel tick = (MajorTickModel)p0;

                // Use the collection index to get the correct date from your data.
                // Then you can return the correct string based on that date.
                return tick.CollectionIndex().ToString();
            }
        }

    Best Regards


  2. Todor
    Admin
    Todor avatar
    798 posts

    Posted 09 Mar Link to this post

    Hello Itamar,

    Thank you for contacting us.

    1. The axes have a property that controls the color of the ticks. You can use it to set a transparent color so that the ticks will not be visible:

    chart.HorizontalAxis.TickColor = Android.Graphics.Color.Transparent;

    2. The gap happens so that the labels of the horizontal axis are fully visible. You can change the current plot mode to between ticks and the gap will be minimized:

    horizontalAxis.PlotMode = AxisPlotMode.BetweenTicks;

    3. I'm not able to reproduce the issue with the LabelFormat. When I set a format as you have ("HH:mm"), it is correctly applied. However, in the end of the post you have included a converter, so I'd like to point out that if you use the converter the value that you return will be used as label instead of the LabelFormat. From the screenshot it seems like you have a more customized approach to the labels which the LabelFormat will not provide. In order to have different labels for the different points, you need to provide a custom label renderer for the axis. Here's a link to our documentation that shows how you can create a custom renderer, the example is for series labels, but the axis labels are quite similar.

    4. As in the second question, the spacing is necessary to accommodate the labels from the horizontal axis, which can be changed with the PlotMode property.

    I hope this answers your questions. Let us know if we can assist you further.

    Regards,
    Todor
    Telerik by Progress
    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
  3. Itamar
    Itamar avatar
    31 posts
    Member since:
    Mar 2016

    Posted 13 Mar in reply to Todor Link to this post


    Thanks for the answer 
    I attached picture of the chart the gap in the right is very big 
    The chart not fill all is parent width 
    Best Regards
  4. Nikolay
    Admin
    Nikolay avatar
    15 posts

    Posted 14 Mar Link to this post

    Hello Itamar,

    Thank you for getting back to us.

    By default the RadChartView should fill the parent width. It looks like the gap is caused by unnecessary padding on the parent element. If that is the problem simply remove the padding or adjust it however you like. Otherwise, please send us code we can use to reproduce the issue.

    I hope this information helps.If you need assistance with anything else please let us know.

    Regards,
    Nikolay
    Telerik by Progress
    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
  5. Itamar
    Itamar avatar
    31 posts
    Member since:
    Mar 2016

    Posted 14 Mar in reply to Nikolay Link to this post

    Thanks for your answer 

    When the chart doesn’t have series, it fills all the parent width (I Attached picture)
     After we add the series it has gap from the right 
    The chart in LinearLayout  match_parent
    There is not padding margin 


    Best Regards

  6. Itamar
    Itamar avatar
    31 posts
    Member since:
    Mar 2016

    Posted 14 Mar in reply to Itamar Link to this post

     Thanks 

    We set horizontalAxis.LastLabelVisibility = AxisLastLabelVisibility.Hidden;
    This solve the gap

    Best Regards

Back to Top