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

Xamarin Telerik - How to use the custom palette for ios

1 Answer 86 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Chong
Top achievements
Rank 1
Chong asked on 06 Apr 2016, 10:06 AM
i am using xamarin and i am going to create a chart, the third party component that i using for the chart is the telerik. The chart is the pie chart. I am following the document of the telerik which is

http://docs.telerik.com/devtools/xamarin/controls/chart/how-to/chart-how-to-create-custom-palette

In the end, the android work well. However when i debug in the simulator, the chart only show me one color which is the first colour of my palette. Is the telerik not support the custom palette for IOS?
The following is my code

var series = new PieSeries();
series.ValueBinding = new Telerik.XamarinForms.Chart.PropertyNameDataPointBinding{PropertyName = "Value"};
series.ItemsSource = data1;
series.ShowLabels = true;
series.ValueBinding = new PropertyNameDataPointBinding("Value");
chart.Series.Add(series);
chart.HeightRequest = 400;
chart.Palette = CustomPalettes.CustomWhite;
chartlayout.Children.Add(chart);


Palette code:

class CustomPalettes{
static CustomPalettes(){
CreateCustomWhitePalette();
}

public static ChartPalette CustomWhite { get; private set; }

private static void CreateCustomWhitePalette(){
ChartPalette palette = new ChartPalette();
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(255, 35, 255), StrokeColor = Color.FromRgb(255, 255, 255) });
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(0, 255, 255), StrokeColor = Color.FromRgb(255, 255, 255) });
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(116, 255, 0), StrokeColor = Color.FromRgb(255, 255, 255) });
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(255, 156, 0), StrokeColor = Color.FromRgb(255, 255, 255) });
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(255, 0, 255), StrokeColor = Color.FromRgb(255, 255, 255) });
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(255, 0, 153), StrokeColor = Color.FromRgb(255, 255, 255) });
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(0, 173, 204), StrokeColor = Color.FromRgb(255, 255, 255) });
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(255, 51, 51), StrokeColor = Color.FromRgb(255, 255, 255) });
palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(255, 255, 51), StrokeColor = Color.FromRgb(255, 255, 255) });
CustomWhite = palette;}}

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 08 Apr 2016, 07:19 AM
Hi Chong,

We already answered to this question in the other thread you opened. Please refer to it and keep the communication there.

Thank you for understanding.

Regards,
Pavel R. Pavlov
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
Chart
Asked by
Chong
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or