CartesianChartGrid for X is not working

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

    Posted 17 Sep Link to this post

    I'm trying to draw GridLines on X axis of RadCartesianChartView with this code:

    CartesianChartGrid grid = new CartesianChartGrid();
                grid.MajorXLinesRenderMode = GridLineRenderMode.All;
                grid.LineThickness = 5;
                grid.LineColor = ContextCompat.GetColor(Activity, Resource.Color.red);
                grid.MajorLinesVisibility = GridLineVisibility.X; 
                _chart.Grid = grid;

    Instead, I get horizontal lines from Y axis.

    The grid also ignores LineThickness and LineColor.

    This is the code for X axis:

    DateTimeCategoricalAxis horizontalAxis = new DateTimeCategoricalAxis();
                horizontalAxis.LineThickness = 5;
                horizontalAxis.LabelSize = 32;
                horizontalAxis.MajorTickInterval = 7;
                horizontalAxis.LabelFormat = "MMM dd";
                PaletteEntry hAxisEntry = customPalette.GetEntry(ChartPalette.HorizontalAxisFamily);
                hAxisEntry.SetCustomValue(CategoricalAxis.LineColorKey, Resources.GetString(Resource.Color.black));
                hAxisEntry.SetCustomValue(CategoricalAxis.LabelColor, Resources.GetString(Resource.Color.dark_blue));
                hAxisEntry.SetCustomValue(CategoricalAxis.TickColorKey, Resources.GetString(Resource.Color.black));

     

  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 26 Sep Link to this post

    Hi Itamar,

    Thanks for writing an please excuse us for the delayed reply. Due to national holidays we are short on staff today and tomorrow. I will answer your question a bit later today.



    Regards,
    Victor
    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. DevCraft banner
  4. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 27 Sep Link to this post

    Hello Itamar,

    Can you please try to set your grid settings after you set the grid on the chart? Do the issues with line color and thickness still occur?

    Regards,
    Victor
    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
    6 posts
    Member since:
    Mar 2016

    Posted 27 Sep in reply to Victor Link to this post

    Yes I have the same issues with the color and the thickness, after I do this:

    _chart.Grid = new CartesianChartGrid();
                _chart.Grid.MajorXLinesRenderMode = GridLineRenderMode.All;
                _chart.Grid.LineThickness = 5;
                _chart.Grid.LineColor = ContextCompat.GetColor(Activity, Resource.Color.red);
                _chart.Grid.MajorLinesVisibility = GridLineVisibility.X; 

     

  6. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 28 Sep Link to this post

    Hello Itamar,

    Thank you for reporting this. This is a bug in our code. We will fix it as soon as possible since I could not find a way to work around it. The same code works in native Android but for some reason not in Xamarin.


    Regards,
    Victor
    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
Back to Top
DevCraft banner