问题如题。
如下代码: Chart chart = new Chart();
chart.Width = 750;
chart.Height = 400;
chart.RenderType = RenderType.ImageTag;
chart.Palette = ChartColorPalette.BrightPastel;
Title t = new Title("年度科研立项统计", Docking.Top, new System.Drawing.Font("Trebuchet MS", 14, System.Drawing.FontStyle.Bold), System.Drawing.Color.FromArgb(26, 59, 105));
chart.Titles.Add(t); foreach (var ID in IDs)
{
Department dep = db.departments.Find(ID);
if (dep != null)
{
chart.ChartAreas.Add(dep.DepartmentName);
chart.Series.Add(dep.DepartmentName);
chart.Series[dep.DepartmentName].Label = "#VAL";
chart.Series[dep.DepartmentName].LegendText = dep.DepartmentName;
chart.Series[dep.DepartmentName].ChartType = SeriesChartType.Line; var query = ...
foreach (var item in query)
{
chart.Series[dep.DepartmentName].Points.AddXY(item.A,item.B);
}
}
} chart.ChartAreas[0].AxisX.Interval = 1; //设置X轴坐标的间隔为1
chart.ChartAreas[0].AxisX.IntervalOffset = 1; //设置X轴坐标偏移为1
chart.ChartAreas[0].AxisX.LabelStyle.IsStaggered = false; //设置是否交错显示,比如数据多的时间分成两行来显示
//chart.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
chart.BorderColor = System.Drawing.Color.FromArgb(26, 59, 105);
chart.BorderlineDashStyle = ChartDashStyle.Solid;
chart.BorderWidth = 2;
chart.Legends.Add("Legend1");再描述一下:
对于折线图(整体大小750*400是可以固定的),当有1条折线时,折线图大小为1;2条时,1/2;4条时,1/4;而我的数据能产生一二十条折线,结果,变鸡巴了。
求高人!
如下代码: Chart chart = new Chart();
chart.Width = 750;
chart.Height = 400;
chart.RenderType = RenderType.ImageTag;
chart.Palette = ChartColorPalette.BrightPastel;
Title t = new Title("年度科研立项统计", Docking.Top, new System.Drawing.Font("Trebuchet MS", 14, System.Drawing.FontStyle.Bold), System.Drawing.Color.FromArgb(26, 59, 105));
chart.Titles.Add(t); foreach (var ID in IDs)
{
Department dep = db.departments.Find(ID);
if (dep != null)
{
chart.ChartAreas.Add(dep.DepartmentName);
chart.Series.Add(dep.DepartmentName);
chart.Series[dep.DepartmentName].Label = "#VAL";
chart.Series[dep.DepartmentName].LegendText = dep.DepartmentName;
chart.Series[dep.DepartmentName].ChartType = SeriesChartType.Line; var query = ...
foreach (var item in query)
{
chart.Series[dep.DepartmentName].Points.AddXY(item.A,item.B);
}
}
} chart.ChartAreas[0].AxisX.Interval = 1; //设置X轴坐标的间隔为1
chart.ChartAreas[0].AxisX.IntervalOffset = 1; //设置X轴坐标偏移为1
chart.ChartAreas[0].AxisX.LabelStyle.IsStaggered = false; //设置是否交错显示,比如数据多的时间分成两行来显示
//chart.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
chart.BorderColor = System.Drawing.Color.FromArgb(26, 59, 105);
chart.BorderlineDashStyle = ChartDashStyle.Solid;
chart.BorderWidth = 2;
chart.Legends.Add("Legend1");再描述一下:
对于折线图(整体大小750*400是可以固定的),当有1条折线时,折线图大小为1;2条时,1/2;4条时,1/4;而我的数据能产生一二十条折线,结果,变鸡巴了。
求高人!
解决方案 »
- DropDownlist 下拉内容显示问题
- 下面的转到第几页怎么实现啊
- DataList
- 关于对页面加载优化的问题
- 动态生成控件
- 视频网站该如何收费?
- 怎样在一个类中给Application赋值?--未将对象引用设置到对象的实例
- TREEVIEW的问题,一直 不能解决
- datagrid中的一列值我是通过模式窗体关闭他时改变值的 回传时这一列值取出来的值还是原来的值 不是我改变后的值 我视图没有禁止 我在别
- 定制一个日历控件的显示日期问题?
- 一个有潜在危险的要求。从客户端中检测到(ctl00$ $ $ contentplaceholder2submit1
- 关于“ArcGIS”开发的几点疑问???
chart.ChartAreas只需设置一次,原因查相关属性