private static void CreateCustomDarkPalette() { ChartPalette palette = new ChartPalette() { Name = "CustomDark" }; // fill palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 40, 152, 228))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 255, 205, 0))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 255, 60, 0))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 210, 202, 202))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 67, 67, 67))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 0, 255, 156))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 109, 49, 255))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 0, 178, 161))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 109, 255, 0))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 255, 128, 0))); // stroke palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 96, 194, 255))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 255, 225, 122))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 255, 108, 79))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 229, 229, 229))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 84, 84, 84))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 0, 255, 156))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 130, 79, 255))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 69, 204, 191))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 185, 255, 133))); palette.StrokeEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 255, 175, 94))); CustomDark = palette; }
protected override void OnNavigatedTo(NavigationEventArgs e) { _diagram = e.Parameter as DiagramViewModel; _diagram.Initialization(); Diagram.Series[0].ItemsSource = _diagram.Datas; ChartPalette palette = new ChartPalette { Name = "CustomsDark" }; foreach (var color in _diagram.Datas) { palette.FillEntries.Brushes.Add(new SolidColorBrush(ColorUtility.GetColorFromHexString(color.Color))); } Diagram.Palette = palette; LabelsListView.ItemsSource = _diagram.Datas; if (!_diagram.IsEmpty) { _diagram.UpdateTile(); } }
private ChartPalette CreateCustomPalette() { var palette = new ChartPalette(); palette.Entries.Add(new PaletteEntry(Color.Blue, Color.Red)); palette.Entries.Add(new PaletteEntry(Color.Gray, Color.Yellow)); return(palette); }
private ChartPalette CreateCustomPalette() { var palette = new ChartPalette(); palette.Entries.Add(new PaletteEntry(Color.Green)); palette.Entries.Add(new PaletteEntry(Color.HotPink)); palette.Entries.Add(new PaletteEntry(Color.Red)); palette.Entries.Add(new PaletteEntry(Color.Yellow)); palette.Entries.Add(new PaletteEntry(Color.Orange)); return(palette); }
public ExampleViewModel() { this.ZoomLevel = 2.7; this.MaxZoomLevel = 8; this.Center = new Location(33.3283678740514, 0.160481929779053); ChartPalette palette = new ChartPalette(); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 236, 191, 52))); palette.FillEntries.Brushes.Add(new SolidColorBrush(Color.FromArgb(255, 255, 247, 220))); this.DoughnutPalette = palette; this.DoughnutAngleRange = new AngleRange(-90, 360); }
private void OnDataContextChanged(FrameworkElement sender, DataContextChangedEventArgs args) { _diagram = args.NewValue as DiagramViewModel; Diagram.Series[0].ItemsSource = _diagram.Datas; ChartPalette palette = new ChartPalette { Name = "CustomsDark" }; foreach (var color in _diagram.Datas) { palette.FillEntries.Brushes.Add(new SolidColorBrush(ColorUtility.GetColorFromHexString(color.Color))); } Diagram.Palette = palette; }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; for (int i = 0; i < 3; i++) { //Create the bar series and attach axes and value bindings. AreaSeries areaSeries = new AreaSeries(); //We want to stack the different area series. areaSeries.CombineMode = ChartSeriesCombineMode.Stack; areaSeries.ValueBinding = new ValueBinding(); areaSeries.CategoryBinding = new CategoryBinding(); //Bind series to data areaSeries.Data = this.getData(); //Add series to chart chart.Series.Add(areaSeries); } ChartPalette defaultPaletteClone = new ChartPalette(chart.Palette); // We acquire the palette entry containing the settings for the third series in the chart setup. PaletteEntry areaSeriesEntry = defaultPaletteClone.GetEntry(ChartPalette.AreaFamily, 2); //We set the fill color of the third series to be cyan. areaSeriesEntry.Fill = Color.Cyan; //We reset the chart palette by applying the new one. chart.Palette = defaultPaletteClone; return(chart); }
private RadCartesianChartView createChart() { //Create the Chart View RadCartesianChartView chart = new RadCartesianChartView(this.Activity); LinearAxis verticalAxis = new LinearAxis(); //The values in the linear axis will not have values after the decimal point. verticalAxis.LabelFormat = "%.0f"; CategoricalAxis horizontalAxis = new CategoricalAxis(); chart.VerticalAxis = verticalAxis; chart.HorizontalAxis = horizontalAxis; for (int i = 0; i < 3; i++) { //Create the bar series and attach axes and value bindings. AreaSeries areaSeries = new AreaSeries(); //We want to stack the different area series. areaSeries.CombineMode = ChartSeriesCombineMode.Stack; areaSeries.ValueBinding = new ValueBinding(); areaSeries.CategoryBinding = new CategoryBinding(); //Bind series to data areaSeries.Data = this.getData(); //Add series to chart chart.Series.Add(areaSeries); } ChartPalette defaultPaletteClone = new ChartPalette(chart.Palette); // We acquire the palette entry containing the settings for the third series in the chart setup. PaletteEntry areaSeriesEntry = defaultPaletteClone.GetEntry(ChartPalette.AreaFamily, 2); //We set the fill color of the third series to be cyan. areaSeriesEntry.Fill = Color.Cyan; //We reset the chart palette by applying the new one. chart.Palette = defaultPaletteClone; return chart; }
public HistoryPage() { InitializeComponent(); historyVM = new HistoryViewModel(); ToolbarItem topLeftText = new ToolbarItem() { Text = "History" }; ToolbarItems.Add(topLeftText); historyVM.Navigation = Navigation; BindingContext = historyVM; Title = Resource.HistoryText; picker.DateSelected += Picker_DateSelected; ChartPalette basePalette = new ChartPalette(); basePalette.Entries.Add(new PaletteEntry() { FillColor = Color.Green, StrokeColor = Color.Green }); basePalette.Entries.Add(new PaletteEntry() { FillColor = Color.Blue, StrokeColor = Color.Blue }); chart.Palette = basePalette; ChartPalette selectedPalette = new ChartPalette(); selectedPalette.Entries.Add(new PaletteEntry() { FillColor = Color.Green, StrokeColor = Color.Green }); selectedPalette.Entries.Add(new PaletteEntry() { FillColor = Color.Blue, StrokeColor = Color.Blue }); chart.SelectionPalette = selectedPalette; }
private void OnCheckMarkClick(object sender, Windows.UI.Xaml.RoutedEventArgs e) { FilterFlyout.Hide(); _diagram.ApplyFilter(StartDatePicker.Date.Date, EndDatePicker.Date.Date); Diagram.Series[0].ItemsSource = null; Diagram.Series[0].ItemsSource = _diagram.Datas; ChartPalette palette = new ChartPalette { Name = "CustomsDark" }; foreach (var color in _diagram.Datas) { palette.FillEntries.Brushes.Add(new SolidColorBrush(ColorUtility.GetColorFromHexString(color.Color))); } Diagram.Palette = palette; LabelsListView.ItemsSource = null; LabelsListView.ItemsSource = _diagram.Datas; }
public ReportViewModel(IReportModel model, string title) { _model = model; Title = title; List = _model.List.Select(item => new TelerikItemReportViewModel { Color = item.CategoryHexColor, Title = item.CategoryTitle, Value = item.Amount, Currency = CurrencyHelper.GetSymbol(item.Currency) }).ToList(); Palette = new ChartPalette { Name = "CustomsDark" }; TotalAmountTitle = $"{_model.TotalAmount} {List.FirstOrDefault()?.Currency}"; foreach (var color in _model.List) { Palette.FillEntries.Brushes.Add(new SolidColorBrush(ColorUtility.GetColorFromHexString(color.CategoryHexColor))); } }
public PaletteObject(string name, ChartPalette palette) { this.name = name; this.palette = palette; }
private void SetLegend(StackPanel legend, ChartPalette palette, ChartSeries series) { int index = 0; foreach (StackPanel panel in legend.Children) { Rectangle rectangle = panel.Children[0] as Rectangle; PaletteEntry? entry = palette.GetEntry(series, index); if ((rectangle != null) && (entry != null)) rectangle.Fill = entry.Value.Fill; index++; } }
private RadPieChartView createChart() { InitChartData(); RadPieChartView pieChartView = new RadPieChartView(this); CustomPieSeries pieSeries = new CustomPieSeries(); pieSeries.ValueBinding = new MonthResultDataBinding("Result"); pieSeries.Data = (Java.Lang.IIterable) this.monthResults; pieSeries.ShowLabels = true; pieSeries.LabelValueToStringConverter = new ValueToStringConverter(); pieSeries.LabelOffset = -50; ChartPalette customPalette = pieChartView.Palette; PaletteEntry paid = customPalette.GetEntry(ChartPalette.PieFamily, 0); paid.Fill = Color.ParseColor("#00757D"); PaletteEntry remaining = customPalette.GetEntry(ChartPalette.PieFamily, 1); remaining.Fill = Color.ParseColor("#75c283"); PaletteEntry overdue = customPalette.GetEntry(ChartPalette.PieFamily, 2); overdue.Fill = Color.ParseColor("#f14844"); //pieChartView.Palette = customPalette; SliceStyle blueStyle = new SliceStyle(); blueStyle.FillColor = Color.ParseColor("#00757D"); blueStyle.StrokeColor = Color.ParseColor("#00757D"); blueStyle.StrokeWidth = 2; blueStyle.ArcColor = Color.White; blueStyle.ArcWidth = 2; SliceStyle greenStyle = new SliceStyle(); greenStyle.FillColor = Color.ParseColor("#75c283"); greenStyle.StrokeColor = Color.ParseColor("#75c283"); greenStyle.StrokeWidth = 2; greenStyle.ArcColor = Color.White; greenStyle.ArcWidth = 2; SliceStyle redStyle = new SliceStyle(); redStyle.FillColor = Color.ParseColor("#f14844"); redStyle.StrokeColor = Color.ParseColor("#f14844"); redStyle.StrokeWidth = 2; redStyle.ArcColor = Color.White; redStyle.ArcWidth = 2; List <SliceStyle> styles = new List <SliceStyle>(); if (this.IsBlue && this.IsGreen && this.IsRed) { styles.Add(blueStyle); styles.Add(greenStyle); styles.Add(redStyle); } else if (this.IsBlue && this.IsGreen) { styles.Add(blueStyle); styles.Add(greenStyle); } else if (this.IsBlue && this.IsRed) { styles.Add(blueStyle); styles.Add(redStyle); } else if (this.IsGreen && this.IsRed) { styles.Add(greenStyle); styles.Add(redStyle); } else if (this.IsBlue) { styles.Add(blueStyle); } else if (this.IsGreen) { styles.Add(greenStyle); } else if (this.IsRed) { styles.Add(redStyle); } pieSeries.SliceStyles = styles; pieChartView.Series.Add(pieSeries); return(pieChartView); }
private void FillColors(Telerik.WinControls.UI.ChartView view, ChartPalette pallete) { view.Palette = null; view.Palette = pallete; }
//private Color _legendcolor; //public Color LegendColor //{ // get // { // return _legendcolor; // } // set // { // _legendcolor = value; // OnPropertyChanged(); // } //} public OverviewView() { InitializeComponent(); //BarSeries5.ItemsSource = GetCategoricalData(); ChartPalette palette = new ChartPalette(); palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(20, 216, 0), StrokeColor = Color.FromRgb(14, 152, 0) }); palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(246, 0, 29), StrokeColor = Color.FromRgb(178, 0, 21) }); palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(255, 206, 0), StrokeColor = Color.FromRgb(186, 150, 0) }); palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(0, 0, 0), StrokeColor = Color.FromRgb(14, 152, 0) }); palette.Entries.Add(new PaletteEntry() { FillColor = Color.FromRgb(155, 155, 0), StrokeColor = Color.FromRgb(14, 152, 0) }); BarSeries1Main.Palette = palette; BarSeries2Main.Palette = palette; BarSeries3Main.Palette = palette; BarSeries4Main.Palette = palette; CheckTutorial10(); //////////// //var date = DateTime.Today; // calendar.AppointmentsSource = new ObservableCollection<Appointment> //{ // new Appointment{ Title = "Tom Birthday", IsAllDay = true, Color = Color.FromHex("#C1D8FF"), Detail ="Buy present!", StartDate = date, EndDate = date.AddHours(12)}, // new Appointment{ Title = "Lunch with Sara", IsAllDay = false, Color = Color.FromHex("#EDFDE3"), Detail ="Discuss the new marketing strategy", StartDate = date.AddDays(1).AddHours(12), EndDate = date.AddDays(1).AddHours(13).AddMinutes(30)}, // new Appointment{ Title = "Security Training", IsAllDay = false, Color = Color.FromHex("#EDFDE3"), Detail ="Details for the event come here", StartDate = date.AddHours(15), EndDate = date.AddHours(16)}, // new Appointment{ Title = "Elle Birthday", IsAllDay = true, Color = Color.FromHex("#FFF1F9"), Detail ="Buy present!", StartDate = date.AddDays(1), EndDate = date.AddDays(1).AddHours(12)}, // new Appointment{ Title = "One to One Meeting", IsAllDay = false, Color = Color.FromHex("#EBF2FD"), Detail ="Details for the event come here - for example place, participants and add information", StartDate = date.AddHours(16), EndDate = date.AddHours(17)}, // new Appointment{ Title = "Marathon", IsAllDay = false, Color = Color.FromHex("#FDE2AC"), Detail ="Enjoy running", StartDate = date.AddHours(8), EndDate = date.AddHours(11)}, //}; // calendar.AppointmentTapped += (sender, e) => // { // Application.Current.MainPage.DisplayAlert(e.Appointment.Title, e.Appointment.Detail, "OK"); // }; //BarSeries4.LegendTitleBinding = PropertyNameDataPointBinding.ClassIdProperty.DefaultBindingMode // BarSeries5.ItemsSource = GetCategoricalData(); //BarSeries6.DataSource = GetCategoricalData(); // BarSeries7.ItemsSource = GetCategoricalData(); // BarSeries3.ItemsSource = GetCategoricalData(); var leftSwipeGesture = new SwipeGestureRecognizer { Direction = SwipeDirection.Left }; leftSwipeGesture.Swiped += SwipeGestureRecognizer_SwipedLeft; OverviewMainGrid.GestureRecognizers.Add(leftSwipeGesture); OverviewMainGrid2.GestureRecognizers.Add(leftSwipeGesture); var rightSwipeGesture = new SwipeGestureRecognizer { Direction = SwipeDirection.Right }; rightSwipeGesture.Swiped += SwipeGestureRecognizer_SwipedRight; OverviewMainGrid.GestureRecognizers.Add(rightSwipeGesture); OverviewMainGrid2.GestureRecognizers.Add(rightSwipeGesture); }