UltraChart屬性設置個人理解(補充完善……)

//創建繪圖區域
ChartArea myChartArea = new ChartArea();
myChartArea.BoundsMeasureType = MeasureType.Percentage;
myChartArea.Bounds =  new Rectangle( 0, 0, 100, 80 );
myChartArea.Border.Thickness = 0;
表明ChartArea繪圖區域佔整個UltraChart的比例:寬100%,高80%,位置呢從左頂點(0,0)起

//創建X軸線
AxisItem xAxis = new AxisItem();
xAxis.axisNumber = AxisNumber.X_Axis;
xAxis.Labels.Orientation = TextOrientation.VerticalLeftFacing;
xAxis.DataType = AxisDataType.String;
xAxis.SetLabelAxisType = SetLabelAxisType.GroupBySeries;
xAxis.Labels.ItemFormatString = "<ITEM_LABEL>";
xAxis.Extent = 10;
此處Extent決定着X軸線偏離繪圖區域邊界的大小,恰當設置軸線的Extent值可以調整圖表區域的大小

//控件默認數據綁定
Infragistics.UltraChart.Resources.Util.DemoSetup(this.UltraChart1);
Infragistics的UltraChart爲其每個圖表類型定製了完美的數據,這可以從其圖表嚮導裏看到。我們並沒有指定圖表的數據,但是我們所設置好圖表屬性後,生成的圖表默認就綁定了些數據,這就是控件所定製而來。

//圖表軸向間距:可以按百分比控制設置
this.UltraChart1.Axis.Y.TickmarkStyle = AxisTickStyle.Percentage;
this.UltraChart1.Axis.Y.TickmarkPercentage = 20;

//圖表軸向間距:可以按照指定數據間隔設置
this.UltraChart1.Axis.Y.TickmarkStyle = AxisTickStyle.DataInterval;
this.UltraChart1.Axis.Y.TickmarkInterval=25;

//設置圖表軸向標籤傾角
this.UltraChart1.Axis.X.Labels.Orientation =Infragistics.UltraChart.Shared.Styles.TextOrientation.Custom;
this.UltraChart1.Axis.X.Labels.OrientationAngle = 240;
this.UltraChart1.Axis.X.Labels.Flip = true; 

//在餅圖上顯示提示信息來代替顯示數據百分比值
this.ultraChart1.PieChart.Labels.Format = Infragistics.UltraChart.Shared.Styles.PieLabelFormat.ItemLabel;
this.ultraChart1.PieChart.Labels.FormatString = "<ITEM_LABEL>";

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章