Hi.
For xamarin android teecharts we use System.Drawing.Colors. For native controls we use Android.Graphics.Color.
But with the same argb components they look different. For example #333333 color in System.Drawing.Color on charts is darker than Android.Graphics.Color?
Maybe there is some property in TChart like shadow which can change chart look, but i can't find it. Alpha is set to opaque.
How to make equal colors?
Thanks in advance.
Xamarind.Android System.Drawing.Color != Android.Color
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Xamarind.Android System.Drawing.Color != Android.Color
Hi Thomas,
Where does this occur in TeeChart? By default, some TeeChart pens are automatically slightly darkened for aesthetic purposes.
BTW, you may also be interested in the Steema.TeeChart.Utils.ToAndroidColor(Color r); method that transforms a System.Drawing.Color color to Android.Graphics.Color.
Where does this occur in TeeChart? By default, some TeeChart pens are automatically slightly darkened for aesthetic purposes.
BTW, you may also be interested in the Steema.TeeChart.Utils.ToAndroidColor(Color r); method that transforms a System.Drawing.Color color to Android.Graphics.Color.
Code: Select all
/// <summary>
///Converts a System.Drawing.Color to Android.Graphics.Color
/// </summary>
public static Android.Graphics.Color ToAndroidColor(Color r)
{
return new Android.Graphics.Color(r.ToArgb());
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Xamarind.Android System.Drawing.Color != Android.Color
Hi Thomas,
You can still eliminate this effect as I suggested here though.Narcís wrote:By default, some TeeChart pens are automatically slightly darkened for aesthetic purposes.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Xamarind.Android System.Drawing.Color != Android.Color
Hi!
It appears in CircularGauge.FaceBrush.Color.
Pen color doesn't help to solve this issue.
Steema.TeeChart.Utils.ToAndroidColor() returns correct color, but it looks darker on the screen.
It appears in CircularGauge.FaceBrush.Color.
Pen color doesn't help to solve this issue.
Steema.TeeChart.Utils.ToAndroidColor() returns correct color, but it looks darker on the screen.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Xamarind.Android System.Drawing.Color != Android.Color
Hi Thomas,
Thanks for your reply. Ok, the problem is not about pens but brushes. I created a chart using this code:
Which produced this chart:
I copied a section of the CircularGauge over the panel to compare colors:
Honestly, using latest TeeChart for Xamarin.Android build (v4.13.12.13) from December 2013, I can not see any difference between circularGauge1.FaceBrush.Color and tChart1.Panel.Color. This can also be seen in red, for example:
Can you see any color differences? Can you reproduce the problem with the code I posted? If not, can you please modify my code snippet so that we can reproduce the problem here? Finally, which TeeChart for Xamarin.Android build are you using?
Thanks in advance.
Thanks for your reply. Ok, the problem is not about pens but brushes. I created a chart using this code:
Code: Select all
private Steema.TeeChart.TChart tChart1;
private void InitializeChart()
{
tChart1 = new Steema.TeeChart.TChart(this);
tChart1.Aspect.View3D = false;
Steema.TeeChart.Themes.BlackIsBackTheme myTheme = new Steema.TeeChart.Themes.BlackIsBackTheme(tChart1.Chart);
myTheme.Apply();
string hexColor = "#333333";
ColorConverter converter = new ColorConverter();
Color c = (Color)converter.ConvertFromString(hexColor);
Steema.TeeChart.Styles.CircularGauge circularGauge1 = new Steema.TeeChart.Styles.CircularGauge(tChart1.Chart);
circularGauge1.FaceBrush.Gradient.Visible = false;
circularGauge1.FaceBrush.Color = c;
tChart1.Panel.Gradient.Visible = false;
tChart1.Panel.Color = c;
SetContentView(tChart1);
}
I copied a section of the CircularGauge over the panel to compare colors:
Honestly, using latest TeeChart for Xamarin.Android build (v4.13.12.13) from December 2013, I can not see any difference between circularGauge1.FaceBrush.Color and tChart1.Panel.Color. This can also be seen in red, for example:
Can you see any color differences? Can you reproduce the problem with the code I posted? If not, can you please modify my code snippet so that we can reproduce the problem here? Finally, which TeeChart for Xamarin.Android build are you using?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Xamarind.Android System.Drawing.Color != Android.Color
The difference appearance not between FaceBrush and Panel colors.
It appears between android LinearLayout background color and Chart Panel color.
Sorry for misleading information.
It appears between android LinearLayout background color and Chart Panel color.
Sorry for misleading information.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Xamarind.Android System.Drawing.Color != Android.Color
Hi Thomas,
I can not reproduce the problem using the code below either:
It produces those screenshots:
Does this code work fine at your end? Can you please modify it so that we can reproduce the problem here?
Thanks in advance.
I can not reproduce the problem using the code below either:
Code: Select all
private Steema.TeeChart.TChart tChart1;
private void InitializeChart()
{
tChart1 = new Steema.TeeChart.TChart(this);
Steema.TeeChart.Themes.BlackIsBackTheme myTheme = new Steema.TeeChart.Themes.BlackIsBackTheme(tChart1.Chart);
myTheme.Apply();
string hexColor = "#333333";
ColorConverter converter = new ColorConverter();
Color c = (Color)converter.ConvertFromString(hexColor);
//c = Color.Red;
Steema.TeeChart.Styles.CircularGauge circularGauge1 = new Steema.TeeChart.Styles.CircularGauge(tChart1.Chart);
circularGauge1.FaceBrush.Gradient.Visible = false;
circularGauge1.FaceBrush.Color = c;
tChart1.Panel.Gradient.Visible = false;
tChart1.Panel.Color = c;
tChart1.Aspect.View3D = false;
tChart1.Zoom.Style = Steema.TeeChart.ZoomStyles.Classic;
LinearLayout layout = new LinearLayout(this);
layout.SetBackgroundColor(Steema.TeeChart.Utils.ToAndroidColor(c));
layout.AddView(tChart1, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, 400));
SetContentView(layout);
}
Does this code work fine at your end? Can you please modify it so that we can reproduce the problem here?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |