Silverlight 圖表控制項 Visifire 常用屬性

來源:互聯網
上載者:User

標籤: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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.