columnVal..._livecharts rowseri">
赞
踩
水平柱状图使用绑定 RowSeries
Labels = new string[] { "09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07", "09-08", "09-09", "09-10" };
Datatimes = new string[] { "09-01", "09-02", "09-03", "09-04" };
List<double> columnValues = new List<double> { 10, 70, 15, 5 };
RowSeries seriesPowerSave = new RowSeries();
seriesPowerSave.Title = "数据1";
seriesPowerSave.Fill = new SolidColorBrush(Color.FromRgb(34, 139, 34));
seriesPowerSave.DataLabels = true;//是否显示柱子上的数值
seriesPowerSave.Foreground = new SolidColorBrush(Color.FromRgb(255, 255, 255));
//显示文本内容
seriesPowerSave.LabelPoint = p => p.Y.ToString();// 显示柱子上的格式
seriesPowerSave.Values = new ChartValues<double>(columnValues);
//柱子宽度
seriesPowerSave.MaxRowHeigth = 20;水平柱子宽度
//seriesPowerSave.Width = 20;
//seriesPowerSave.MaxColumnWidth = 20;
Collection.Add(seriesPowerSave);
正常柱状图使用ColumnSeries
ColumnSeries seriesPowerSave = new ColumnSeries();
seriesPowerSave.Title = "数据1";
seriesPowerSave.Fill = new SolidColorBrush(Color.FromRgb(34, 139, 34));
seriesPowerSave.DataLabels = true;//是否显示柱子上的数值
seriesPowerSave.Foreground = new SolidColorBrush(Color.FromRgb(255, 255, 255));
//显示文本内容
seriesPowerSave.LabelPoint = p => p.Y.ToString();// 显示柱子上的格式
seriesPowerSave.Values = new ChartValues<double>(columnValues);
//柱子宽度
seriesPowerSave.Width = 20;
seriesPowerSave.MaxColumnWidth = 20;//正常柱子宽度
Collection.Add(seriesPowerSave);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。