This is a migrated thread and some comments may be shown as answers.

CartesianChartGrid for X is not working

4 Answers 61 Views
Chart - Xamarin.Android
This is a migrated thread and some comments may be shown as answers.
Itamar
Top achievements
Rank 1
Itamar asked on 18 Sep 2016, 04:48 AM

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));

 

4 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 26 Sep 2016, 06:54 AM
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
0
Victor
Telerik team
answered on 27 Sep 2016, 08:50 AM
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
0
Itamar
Top achievements
Rank 1
answered on 27 Sep 2016, 10:08 AM

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; 

 

0
Victor
Telerik team
answered on 28 Sep 2016, 12:07 PM
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
Tags
Chart - Xamarin.Android
Asked by
Itamar
Top achievements
Rank 1
Answers by
Victor
Telerik team
Itamar
Top achievements
Rank 1
Share this question
or