標籤:style blog http color io 資料 for art
首要介紹 Visifire 常用屬性的設定,用來產生不合樣式的圖例
設定Chart的屬
//設定title的值
// 建立一個題目標對象
Title title = new Title();
// 設定題目標名稱
title.Text = titleText;
title.Padding = new Thickness(0, 10, 5, 0);
// 向表徵圖添加題目
chart.Titles.Add(title);
//是否顯示3D結果
chart.View3D = view3D;
//圖表資料過多遷移轉變顯示
chart.ScrollingEnabled = isScroll;
chart.Watermark = false;//去掉浮水印
//設定繪製圖表的外形 (列舉)
ds.RenderAs = RenderAs.Column;
// 設定繪製線條的樣式
ds.Linetyle = LineStyles.Dotted;
//表徵圖描述
ds.LegendText = legendText;
ds.ShowInLegend = showLegend;
//是否顯示座標點資料
ds.LabelEnabled = showLabel;
設定座標軸的屬性
#region 設定x抽資訊
AxisLabels xLabel = new AxisLabels();
xLabel.FontColor = new SolidColorBrush(Colors.Gray); //x軸刻度文本資訊色彩
ChartGrid xGrid = new ChartGrid();//設定x軸的縱向刻度虛線
xGrid.Enabled = false;
Axis xAxis = new Axis();
xAxis.Enabled = true; //是否顯示X軸刻度、文本
xAxis.AxisLabels = xLabel;
xAxis.Grids.Add(xGrid);
chart.AxesX.Add(xAxis);
#endregion
#region 設定y抽資訊
AxisLabels yLabel = new AxisLabels();
yLabel.FontColor = new SolidColorBrush(Colors.LightGray); //y軸刻度文本資訊色彩
ChartGrid yGrid = new ChartGrid();// 設定y軸的橫向刻度虛線
yGrid.Enabled = true;
Axis yAxis = new Axis();
yAxis.Enabled = yAxisEnabeld; //是否顯示Y軸刻度、文本
yAxis.Grids.Add(yGrid);
yAxis.AxisMinimum = minValue; //y軸刻度最小值
yAxis.AxisMaximum = maxValue; //y軸刻度最大值
yAxis.Prefix = pre; //"給刻度添加首碼";
yAxis.Suffix = suf; //"給刻度添加尾碼 如%";
yAxis.Interval = 10; //設定y軸刻度的增量 -- 即2個刻度值之間的的間隔
yAxis.IntervalType = IntervalTypes.Number;
yAxis.AxisLabels = yLabel;
chart.AxesY.Add(yAxis);
#endregion
設定座標軸各資料的屬性
//設定座標點的大小(線條圖)
dp.MarkerScale = 10;
dp.MarkerSize = 5;
//座標點的色彩
dp.Color = new SolidColorBrush(Colors.Red);
//座標點數值的色彩
dp.LabelFontColor = new SolidColorBrush(Colors.Blue);
參考:http://www.cnblogs.com/forgetu/archive/2010/06/26/visifire-axis.html
摘自:http://www.mysjtu.com/page/M0/S918/918008.html