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

Line chart does not respond to background color

3 Answers 99 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 09 Apr 2019, 09:38 AM

Hello all,

 

I'm trying to set the background color of my line chart (RadCartesianChart). This is the code that i'm using:

 

```

  var chart = new RadCartesianChart
            {
                BackgroundColor = Color.Black,
                VerticalOptions = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.Fill,
                HeightRequest = Device.RuntimePlatform == Device.Android ? 200 : 250,
                HorizontalAxis = new CategoricalAxis
                {               
                    LabelTextColor = AppResources.Get<Color>("TextColor"),
                    LabelFontSize = 10,
                    LabelFitMode = AxisLabelFitMode.Rotate,
                    LabelFormatter = new HorizontalAxisLabelFormatter()
                },
                VerticalAxis = new NumericalAxis
                {
                    LabelTextColor = AppResources.Get<Color>("TextColor"),
                    LabelFontSize = 10,
                    LabelFormatter = new VerticalAxisLabelFormatter()
                },
            };

```

 

However, when i run this in the iOS simulator, the result is as follows (see attachment).

 

The background color stays white. The labels do go white, but the chart itself does not.

When i try to do this with a bar chart, it does work. On Android the chart also has a black background color.

Does anybody know what I am missing?

 

Thanks in advance,

Reense

3 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 09 Apr 2019, 01:17 PM
Hello Peter,

Thank you for the provided code.

I have tested the described scenario but on my side the BackgroundColor is applied to the RadChart control as expected. I have attached my test project for reference. Please take a look at it and may I ask you to modify it accordion your setup and send it back to me? In this way I could research it further. Also note that you should open a support ticket and attach the project there because in the forum only image attachments are allowed.

Thank you in advance.

Regards,
Didi
Progress 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
0
Peter
Top achievements
Rank 1
answered on 10 Apr 2019, 07:58 AM

Hey, thanks for replying!

I tried the sample you provided. However, when I try to run this, Visual Studio says that it can't find the package Telerik.UI.for.Xamarin version 2019.1.318.1. When I manually install Telerik.UI.for.Xamarin version 2018.1.405.2 (latest stable release) I still get the same, the line chart has a white background. I attached a screenshot with my result.

The only thing that i've done to your sample is installing the latest stable release of the package from the nuget source. No source code is altered.

 

Is the background problem specific to this release of Telerik.UI.for.Xamarin?

 

 


0
Didi
Telerik team
answered on 10 Apr 2019, 09:32 AM
Hello Peter,

Thank you for the attached file.

I have tested the scenario with Telerik UI for Xamarin v 2018.1.405.2 but I could not reproduce the issue with the chart background color. I have attached the project and image for reference. Regarding to the Telerik UI for Xamarin versions please note that the latest stable version of the suite is 2019.1.318.1.

Next Steps:

Please open a support ticket and attach a modified version of the project with the exact setup you have. Once we are able to reproduce the behavior we will be able to investigate it further and provide more information on the matter.

Thank you in advance.

Regards,
Didi
Progress 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
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Didi
Telerik team
Peter
Top achievements
Rank 1
Share this question
or