2X faster development
The ultimate UWP UI toolkit to boost your development speed.
Description: SfChart makes look of the chart good by supporting color customization. It helps you to color the series as per your requirement. Solution: The default color for the series is blue (#FF1BA1E2); it can be customized to any other color for the individual segments. This can be done by setting the Palette property to Custom. You can then define the required list of custom brushes, and assign them to the ColorModel property. XAML <chart:ColumnSeries Palette="Custom" XBindingPath="Label" YBindingPath="Price" ItemsSource="{Binding List1}"> <chart:ColumnSeries.ColorModel> <chart:ChartColorModel> <chart:ChartColorModel.CustomBrushes> <SolidColorBrush Color="#FF245324"/> <SolidColorBrush Color="#FF202064"/> <SolidColorBrush Color="#FF7E1818" /> <SolidColorBrush Color="#FF9C9C27"/> <SolidColorBrush Color="#FFAC6060"/> <SolidColorBrush Color="#FF4D8B85"/> </chart:ChartColorModel.CustomBrushes> </chart:ChartColorModel> </chart:ColumnSeries.ColorModel> </chart:ColumnSeries>
C# chart.Series[0].Palette = ChartColorPalette.Custom; chart.Series[0].ColorModel.CustomBrushes = new List<Brush>(); chart.Series[0].ColorModel.CustomBrushes.Add(new SolidColorBrush(Color.FromArgb(250, 0x24, 0x53, 0x24))); chart.Series[0].ColorModel.CustomBrushes.Add(new SolidColorBrush(Color.FromArgb(250, 0x20, 0x20, 0x64))); chart.Series[0].ColorModel.CustomBrushes.Add(new SolidColorBrush(Color.FromArgb(250, 0x7E, 0x18, 0x18))); chart.Series[0].ColorModel.CustomBrushes.Add(new SolidColorBrush(Color.FromArgb(250, 0x9C, 0x9C, 0x27))); chart.Series[0].ColorModel.CustomBrushes.Add(new SolidColorBrush(Color.FromArgb(250, 0xAC, 0x60, 0x60))); chart.Series[0].ColorModel.CustomBrushes.Add(new SolidColorBrush(Color.FromArgb(250, 0x4D, 0x8B, 0x85))); OutputFigure 1: Custom brushes applied to segments. |
2X faster development
The ultimate UWP UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.