- Home
- Forum
- Xamarin.Forms
- Chart saved with black background on Android
Chart saved with black background on Android
Thanks for using Syncfusion products.
We were unable to reproduce the reported issue at our end and we have prepared the sample for this. Please update us modified sample or chart related code snippet based on your application to reproduce the issue which will be helpful for providing further assistance on this.
Sample: http://www.syncfusion.com/downloads/support/forum/132857/ze/SaveAsImage-1257935093
Also, we would like to inform you that the default background color of the Chart is white and default color of the axis is black.
Regards,
Parthiban S
Hi Parthiban ,
here is the Code I use, I cut out the Axis and Legend initialisation to shorten it.
By the way, the CustomColorPalette does not work as well, ChartColorCollection is not recognized but I found a workaround.
The images I get from this code are still with black background and white axes.
Xamarin.Forms.Color[] Colors = new Xamarin.Forms.Color[] {
Xamarin.Forms.Color.Green, Xamarin.Forms.Color.Yellow, Xamarin.Forms.Color.Red, Xamarin.Forms.Color.Gray };
SfChart ColumnChart = new SfChart()
{
WidthRequest = 50,
HeightRequest = 250,
BackgroundColor = UIResources.Color17, //this is white
//ColorModel = new ChartColorModel()
//{
// Palette = ChartColorPalette.Custom,
// CustomBrushes = new ChartColorCollection()
// {
// Color.Green
// Color.Yellow,
// Color.Red,
// Color.Gray,
// }
//},
};
int i = 0;
foreach (ObservableCollection<DiagrammWerte> col in pdfWert.DiagrammData.werte)
{
ColumnSeries series = new ColumnSeries()
{
ItemsSource = col,
XBindingPath = "X",
YBindingPath = "Y",
Label = pdfWert.DiagrammData.legendenText[i],
Color = Colors[i],
};
StackedChart.Series.Add(series);
i++;
}
content.Children.Add(StackedChart);
StackedChart.SaveAsImage("chart.jpg");
Thanks for the update.
We have created an incident under your Direct Trac account. So, we request to follow the incident for further details.
Our Direct Trac support system can be accessed from the following link:
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents
Regards,
Parthiban S
- 3 Replies
- 2 Participants
-
ML Mareike Leja
- Sep 25, 2017 04:26 PM UTC
- Oct 6, 2017 12:22 PM UTC