首选配置控件的属性,html代码略,设控件id="chard" ,可以在Page_Load事件中加入
如果是饼型图,按下列生成DataTable 实例
一定要按规定的格式生成DataTable ,不然会报错;且除标签列允许为字符型外,其它列均只能是数值类型
三、绑定数据源,既可完成
chart.DataSource=GetChartData(table);
chart.DataBind();
if
(
!
IsPostBack)
{
chart.ChartImagesPath="../ChartImages";
chart.ImagePipePageName="../ImagePipe.aspx";//使用ImagePipe.aspx生成的图像输出,ImagePipe.aspx页可以在natvatanges的演示示例中找到
chart.DeploymentScenario.FilePath="..//ChartImages";
chart.DeploymentScenario.Scenario=Infragistics.UltraChart.Shared.Styles.ImageDeploymentScenario.Session; //必须配置成Session才可以用ImagePipe.aspx生成的图像输出,缺省为在chart.ChartImagesPath生成图片
chart.DeploymentScenario.RenderingType=RenderingType.Image;
chart.DeploymentScenario.ImageType=System.Drawing.Imaging.ImageFormat.Jpeg;
chart.EmptyChartText="没有任何数据";
/**//*
chart.ColumnChart.ChartText[0].VerticalAlign=System.Drawing.StringAlignment.Far;//如是矩型图设置在矩型上面显示
chart.ColumnChart.ChartText[0].ItemFormatString="<DATA_VALUE:##0.00>";//设置值的格式
*/
}
{
chart.ChartImagesPath="../ChartImages";
chart.ImagePipePageName="../ImagePipe.aspx";//使用ImagePipe.aspx生成的图像输出,ImagePipe.aspx页可以在natvatanges的演示示例中找到
chart.DeploymentScenario.FilePath="..//ChartImages";
chart.DeploymentScenario.Scenario=Infragistics.UltraChart.Shared.Styles.ImageDeploymentScenario.Session; //必须配置成Session才可以用ImagePipe.aspx生成的图像输出,缺省为在chart.ChartImagesPath生成图片
chart.DeploymentScenario.RenderingType=RenderingType.Image;
chart.DeploymentScenario.ImageType=System.Drawing.Imaging.ImageFormat.Jpeg;
chart.EmptyChartText="没有任何数据";
/**//*
chart.ColumnChart.ChartText[0].VerticalAlign=System.Drawing.StringAlignment.Far;//如是矩型图设置在矩型上面显示
chart.ColumnChart.ChartText[0].ItemFormatString="<DATA_VALUE:##0.00>";//设置值的格式
*/
}
二、创建数据源
如是柱型图请按下列样式生成DataTable实例
如是柱型图请按下列样式生成DataTable实例
标签
|
第一季度
|
第二季度
|
系列1
|
¥20000
|
¥25000
|
系列2
|
¥10000
|
¥15000
|
如果是饼型图,按下列生成DataTable 实例
标签
|
金额
|
系列1
|
¥30000
|
系列2
|
¥50000
|
系列3
|
¥40000
|
一定要按规定的格式生成DataTable ,不然会报错;且除标签列允许为字符型外,其它列均只能是数值类型
三、绑定数据源,既可完成
chart.DataSource=GetChartData(table);
chart.DataBind();