public Animation() { InitializeComponent(); chart.View.AxisY.Min = 0; chart.View.AxisY.Max = 100; BarColumnOptions.SetRadiusX(chart, 2); BarColumnOptions.SetRadiusY(chart, 2); chart.ChartType = ChartType.Column; NewData(); }
public AggregateChart() { InitializeComponent(); _dict["red"] = CreateBrush(Colors.Red); _dict["blue"] = CreateBrush(Color.FromArgb(255, 2, 150, 252)); _dict["yellow"] = CreateBrush(Colors.Yellow); cb.ItemsSource = Utils.GetEnumValues(typeof(Aggregate)); cb.SelectedIndex = 0; cb.SelectionChanged += (s, e) => chart.Aggregate = (Aggregate)cb.SelectedIndex; int cnt = 30; chart.Data.ItemNames = CreateRandomStrings(cnt, new string[] { "blue", "red", "yellow" });; chart.View.AxisX.AnnoVisibility = AnnoVisibility.ShowAll; var vals = CreateRandomValues(cnt); var ds = new DataSeries() { ValuesSource = vals }; ds.PlotElementLoaded += (s, e) => { PlotElement pe = (PlotElement)s; if (_dict.ContainsKey(pe.DataPoint.Name)) { pe.Fill = _dict[pe.DataPoint.Name]; } pe.StrokeThickness = 0; }; chart.Data.Children.Add(ds); chart.View.AxisX.AnnoTemplate = chart.Resources["al_tmpl"]; BarColumnOptions.SetRadiusX(chart, 4); BarColumnOptions.SetRadiusY(chart, 4); }
void CreateData() { chart.Data.Children.Clear(); for (int i = 0; i < 10; i++) { DataSeries ds = new DataSeries() { ValuesSource = CreateRandomArray(5) }; // ds.SymbolFill = brushes[i]; BarColumnOptions.SetStackGroup(ds, i % 2); chart.Data.Children.Add(ds); } chart.Data.Children.Add(new DataSeries() { ChartType = ChartType.LineSymbols, ValuesSource = CreateRandomArray(5), ConnectionStrokeThickness = 5, ConnectionStroke = new SolidColorBrush(Colors.Orange) }); }
void CreateData() { _chart.Data.Children.Clear(); for (int i = 0; i < 10; i++) { DataSeries ds = new DataSeries() { ValuesSource = CreateRandomArray(5), Label = "series " + i }; BarColumnOptions.SetStackGroup(ds, i % 2); _chart.Data.Children.Add(ds); } _chart.Data.Children.Add(new DataSeries() { ChartType = ChartType.LineSymbols, ValuesSource = CreateRandomArray(5), ConnectionStrokeThickness = 5, Label = "series 10" }); }