修改进度模块
This commit is contained in:
@@ -258,5 +258,114 @@ namespace Web.Controls
|
||||
|
||||
Controls.Add(chart1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建自定义Chart图形
|
||||
/// </summary>
|
||||
/// <param name="dt">数据源</param>
|
||||
/// <param name="width">宽度</param>
|
||||
/// <param name="height">高度</param>
|
||||
public void CreateMaryChartJD(DataTable dt, int width, int height, string projectShortName)
|
||||
{
|
||||
Chart chart1 = new Chart();
|
||||
chart1.ID = "chart1";
|
||||
chart1.BackColor = Color.WhiteSmoke;
|
||||
chart1.ImageLocation = "~/Images/ChartPic_#SEQ(300,3)";
|
||||
chart1.BorderlineDashStyle = ChartDashStyle.Solid;
|
||||
chart1.Palette = ChartColorPalette.BrightPastel;
|
||||
chart1.BackSecondaryColor = Color.White;
|
||||
chart1.BackGradientStyle = GradientStyle.TopBottom;
|
||||
chart1.BorderWidth = 2;
|
||||
chart1.BorderColor = Color.FromArgb(26, 59, 105);
|
||||
chart1.ImageType = ChartImageType.Png;
|
||||
|
||||
chart1.Width = width;
|
||||
chart1.Height = height;
|
||||
|
||||
Title title = new Title();
|
||||
title.Text = "赢得值曲线";
|
||||
if (!string.IsNullOrEmpty(projectShortName))
|
||||
{
|
||||
title.Text = projectShortName + "赢得值曲线";
|
||||
}
|
||||
title.Text = BLL.Funs.GetSubStr(title.Text, 30);
|
||||
title.ToolTip = title.Text;
|
||||
title.ShadowColor = Color.FromArgb(32, 0, 0, 0);
|
||||
title.Font = new Font("Trebuchet MS", 10F, FontStyle.Bold);
|
||||
title.ShadowOffset = 3;
|
||||
title.ForeColor = Color.FromArgb(26, 59, 105);
|
||||
chart1.Titles.Add(title);
|
||||
|
||||
Legend legend1 = new Legend();
|
||||
legend1.TextWrapThreshold = 1;
|
||||
legend1.Docking = Docking.Right;
|
||||
legend1.Alignment = StringAlignment.Center;
|
||||
legend1.BackColor = Color.Transparent;
|
||||
legend1.Font = new Font(new FontFamily("Trebuchet MS"), 8);
|
||||
legend1.LegendStyle = LegendStyle.Column;
|
||||
legend1.IsEquallySpacedItems = true;
|
||||
legend1.IsTextAutoFit = false;
|
||||
chart1.Legends.Add(legend1);
|
||||
|
||||
ChartArea chartArea = new ChartArea();
|
||||
chartArea.BackColor = Color.Transparent;
|
||||
chartArea.AxisX.IsLabelAutoFit = false;
|
||||
chartArea.AxisY.IsLabelAutoFit = false;
|
||||
chartArea.AxisX.LabelStyle.Font = new Font("Verdana,Arial,Helvetica,sans-serif", 8F, FontStyle.Regular);
|
||||
chartArea.AxisY.LabelStyle.Font = new Font("Verdana,Arial,Helvetica,sans-serif", 8F, FontStyle.Regular);
|
||||
//chartArea.AxisY.LabelStyle.Format = "#(万元)";
|
||||
chartArea.AxisY.LineColor = Color.FromArgb(64, 64, 64, 64);
|
||||
chartArea.AxisX.LineColor = Color.FromArgb(64, 64, 64, 64);
|
||||
chartArea.AxisY.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);
|
||||
chartArea.AxisX.MajorGrid.LineColor = Color.FromArgb(64, 64, 64, 64);
|
||||
chartArea.AxisX.Interval = 1;
|
||||
chartArea.Area3DStyle.Enable3D = false;
|
||||
chart1.ChartAreas.Add(chartArea);
|
||||
|
||||
chart1.Series.Add("本月概算工程量");
|
||||
chart1.Series.Add("本月实际工程量");
|
||||
chart1.Series.Add("累计概算工程量");
|
||||
chart1.Series.Add("累计实际工程量");
|
||||
|
||||
DataView dv = dt.DefaultView;
|
||||
|
||||
chart1.Series["本月概算工程量"].Points.DataBindXY(dv, "月份", dv, "本月概算工程量");
|
||||
chart1.Series["本月概算工程量"].ChartType = SeriesChartType.Column;
|
||||
|
||||
for (int i = 0; i < chart1.Series["本月概算工程量"].Points.Count; i++)
|
||||
{
|
||||
chart1.Series["本月概算工程量"].Points[i].ToolTip = "本月概算工程量\n#VALX\n#VALY";
|
||||
}
|
||||
|
||||
chart1.Series["本月实际工程量"].Points.DataBindXY(dv, "月份", dv, "本月实际工程量");
|
||||
chart1.Series["本月实际工程量"].ChartType = SeriesChartType.Column;
|
||||
|
||||
for (int i = 0; i < chart1.Series["本月实际工程量"].Points.Count; i++)
|
||||
{
|
||||
chart1.Series["本月实际工程量"].Points[i].ToolTip = "本月实际工程量\n#VALX\n#VALY";
|
||||
}
|
||||
|
||||
chart1.Series["累计概算工程量"].Points.DataBindXY(dv, "月份", dv, "累计概算工程量");
|
||||
chart1.Series["累计概算工程量"].ChartType = SeriesChartType.Spline;
|
||||
chart1.Series["累计概算工程量"].Color = Color.MediumSeaGreen;
|
||||
chart1.Series["累计概算工程量"].BorderWidth = 2;
|
||||
|
||||
for (int i = 0; i < chart1.Series["累计概算工程量"].Points.Count; i++)
|
||||
{
|
||||
chart1.Series["累计概算工程量"].Points[i].ToolTip = "累计概算工程量\n#VALX\n#VALY";
|
||||
}
|
||||
|
||||
chart1.Series["累计实际工程量"].Points.DataBindXY(dv, "月份", dv, "累计实际工程量");
|
||||
chart1.Series["累计实际工程量"].ChartType = SeriesChartType.Spline;
|
||||
chart1.Series["累计实际工程量"].Color = Color.Red;
|
||||
chart1.Series["累计实际工程量"].BorderWidth = 2;
|
||||
|
||||
for (int i = 0; i < chart1.Series["累计实际工程量"].Points.Count; i++)
|
||||
{
|
||||
chart1.Series["累计实际工程量"].Points[i].ToolTip = "累计实际工程量\n#VALX\n#VALY";
|
||||
}
|
||||
|
||||
Controls.Add(chart1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user