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>";

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