请教一个绘制多图zedGraph的问题 GraphPane myPaneT = new GraphPane(new Rectangle(40, 40, 500, 250), "Case #" + (j+1).ToString(), "时间", "电压");Rectangle 矩形框设置的够么?更改下看看。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 好久没写,给以前的代码参考下 /// <summary> /// 画出图片 /// </summary> /// <param name="arrvalues"></param> /// <param name="titles"></param> private void bindStat(double[] arrvalues, string[] titles, Color[] colors) { this.zedGraphControl1.GraphPane.Title.Text = ""; this.zedGraphControl1.GraphPane.XAxis.Title.Text = "班级"; this.zedGraphControl1.GraphPane.YAxis.Title.Text = "数量"; this.zedGraphControl1.GraphPane.CurveList.Clear(); this.zedGraphControl1.GraphPane.GraphObjList.Clear(); this.zedGraphControl1.GraphPane.Fill = new Fill(Color.White, Color.LightSkyBlue, 45.0f); this.zedGraphControl1.GraphPane.Chart.Fill = new Fill(Color.White, Color.LightSeaGreen, 45.0f); double[] arrValues = new double[titles.Length]; string[] xtitles = titles; this.zedGraphControl1.GraphPane.YAxis.Scale.Min = 0; GraphPane myPane = this.zedGraphControl1.GraphPane; for (int i = 0; i < titles.Length; i++) { for (int m = 0; m < titles.Length; m++) { if (i == m) { arrValues[m] = arrvalues[m]; } else { arrValues[m] = 0; } } BarItem myBar = this.zedGraphControl1.GraphPane.AddBar(titles[i], null, arrValues, colors[i]); myBar.Bar.Fill = new Fill(colors[i], Color.White, colors[i]); myBar.Bar.Border.Color = Color.Transparent; if (!arrValues[i].ToString().Equals("0")) { TextObj va = new TextObj(arrValues[i].ToString(), i + 1, arrValues[i]+0.6, CoordType.AxisXYScale, AlignH.Center, AlignV.Center); va.FontSpec = new FontSpec("宋体", 11, Color.Black, false, false, true); va.FontSpec.Border.IsVisible = false; // 是否有边框 va.FontSpec.Fill.Color = Color.Transparent; va.FontSpec.IsUnderline = false; myPane.GraphObjList.Add(va); // 填充 } } this.zedGraphControl1.GraphPane.YAxis.MinSpace = 0; List<string> list = new List<string>(); for (int i = 0; i < xtitles.Length; i++) { string value = ""; for (int j = 0; j < xtitles[i].Length; j++) { value += xtitles[i][j] + "\r\n"; } list.Add(value); } string[] listvalue = new string[list.Count]; for (int k = 0; k < list.Count; k++) { listvalue[k] = list[k]; } //this.zedGraphControl1.GraphPane.XAxis.Scale.FontSpec.Angle= float.Parse("90"); this.zedGraphControl1.GraphPane.XAxis.Scale.TextLabels = listvalue; this.zedGraphControl1.GraphPane.XAxis.Scale.FontSpec.Size = 8; this.zedGraphControl1.GraphPane.XAxis.Type = AxisType.Text; this.zedGraphControl1.GraphPane.BarSettings.Type = BarType.Overlay; this.zedGraphControl1.GraphPane.YAxis.Scale.MajorStep = 5; this.zedGraphControl1.GraphPane.XAxis.MajorTic.IsBetweenLabels = true; this.zedGraphControl1.AxisChange(); this.zedGraphControl1.Refresh(); } #endregion //动态创建视图 operation.CreateViwPro(dtpStartTime.Value.ToString(), dtpEndTime.Value.ToString()); string strWhere = ""; if (ltvDeptInfo.CheckedItems.Count > 0) { strWhere = " Where "; } string[] names = new string[ltvDeptInfo.CheckedItems.Count]; for (int i = 0; i < ltvDeptInfo.CheckedItems.Count; i++) { strWhere += " c.deptid = '" + ltvDeptInfo.CheckedItems[i].Tag.ToString() + "'"; if (i < ltvDeptInfo.CheckedItems.Count - 1) { strWhere += " or"; } } DataTable dt = operation.GetOutTimeDocInfo(strWhere, dtpStartTime.Value.ToShortDateString(), dtpEndTime.Value.ToShortDateString()); SetStatisticalTable(dt); double[] arrvalues = new double[dt.Rows.Count]; Color[] colors = new Color[dt.Rows.Count]; for (int j = 0; j < dt.Rows.Count; j++) { names[j] = dt.Rows[j]["deptname"].ToString(); string count = "0"; if (dt.Rows[j]["doccount"].ToString() != "") { count = dt.Rows[j]["doccount"].ToString(); } arrvalues[j] = double.Parse(count); colors[j] = GetColor(); } bindStat(arrvalues, names, colors); } C# Window Media Player控件 有没有办法用C#编写的代码来播放vcd,dvd等光盘? c#子窗体与子窗体之间的内容的链接 请问在同一页面内 左侧是超链接文字, 右侧是打开超链接文字的网页 该如何实现? 送分问题!!!!!!!!! WPF 有关椭圆的位置 请问怎么样用C#编程,在IE界面上显示AutoCAD文件? 请问winform中如何对字串进行SHA1加密?? 使用webbrowser控件的页面刷新问题! 问个关于C#的简单问题 C# 向游戏发控制消息(急) 新手求组win7下重写uninstall方法删除注册表项及子项不成功求助
/// 画出图片
/// </summary>
/// <param name="arrvalues"></param>
/// <param name="titles"></param>
private void bindStat(double[] arrvalues, string[] titles, Color[] colors)
{
this.zedGraphControl1.GraphPane.Title.Text = "";
this.zedGraphControl1.GraphPane.XAxis.Title.Text = "班级";
this.zedGraphControl1.GraphPane.YAxis.Title.Text = "数量";
this.zedGraphControl1.GraphPane.CurveList.Clear();
this.zedGraphControl1.GraphPane.GraphObjList.Clear();
this.zedGraphControl1.GraphPane.Fill = new Fill(Color.White, Color.LightSkyBlue, 45.0f);
this.zedGraphControl1.GraphPane.Chart.Fill = new Fill(Color.White, Color.LightSeaGreen, 45.0f);
double[] arrValues = new double[titles.Length];
string[] xtitles = titles;
this.zedGraphControl1.GraphPane.YAxis.Scale.Min = 0;
GraphPane myPane = this.zedGraphControl1.GraphPane;
for (int i = 0; i < titles.Length; i++)
{
for (int m = 0; m < titles.Length; m++)
{
if (i == m)
{
arrValues[m] = arrvalues[m];
}
else
{
arrValues[m] = 0;
}
}
BarItem myBar = this.zedGraphControl1.GraphPane.AddBar(titles[i], null, arrValues, colors[i]);
myBar.Bar.Fill = new Fill(colors[i], Color.White, colors[i]);
myBar.Bar.Border.Color = Color.Transparent;
if (!arrValues[i].ToString().Equals("0"))
{
TextObj va = new TextObj(arrValues[i].ToString(), i + 1, arrValues[i]+0.6, CoordType.AxisXYScale, AlignH.Center, AlignV.Center);
va.FontSpec = new FontSpec("宋体", 11, Color.Black, false, false, true);
va.FontSpec.Border.IsVisible = false; // 是否有边框
va.FontSpec.Fill.Color = Color.Transparent;
va.FontSpec.IsUnderline = false; myPane.GraphObjList.Add(va); // 填充
} }
this.zedGraphControl1.GraphPane.YAxis.MinSpace = 0;
List<string> list = new List<string>();
for (int i = 0; i < xtitles.Length; i++)
{
string value = "";
for (int j = 0; j < xtitles[i].Length; j++)
{
value += xtitles[i][j] + "\r\n";
}
list.Add(value);
} string[] listvalue = new string[list.Count];
for (int k = 0; k < list.Count; k++)
{
listvalue[k] = list[k];
} //this.zedGraphControl1.GraphPane.XAxis.Scale.FontSpec.Angle= float.Parse("90");
this.zedGraphControl1.GraphPane.XAxis.Scale.TextLabels = listvalue;
this.zedGraphControl1.GraphPane.XAxis.Scale.FontSpec.Size = 8;
this.zedGraphControl1.GraphPane.XAxis.Type = AxisType.Text;
this.zedGraphControl1.GraphPane.BarSettings.Type = BarType.Overlay;
this.zedGraphControl1.GraphPane.YAxis.Scale.MajorStep = 5;
this.zedGraphControl1.GraphPane.XAxis.MajorTic.IsBetweenLabels = true;
this.zedGraphControl1.AxisChange();
this.zedGraphControl1.Refresh();
}
#endregion
//动态创建视图
operation.CreateViwPro(dtpStartTime.Value.ToString(), dtpEndTime.Value.ToString()); string strWhere = ""; if (ltvDeptInfo.CheckedItems.Count > 0)
{
strWhere = " Where ";
}
string[] names = new string[ltvDeptInfo.CheckedItems.Count];
for (int i = 0; i < ltvDeptInfo.CheckedItems.Count; i++)
{
strWhere += " c.deptid = '" + ltvDeptInfo.CheckedItems[i].Tag.ToString() + "'"; if (i < ltvDeptInfo.CheckedItems.Count - 1)
{
strWhere += " or";
} }
DataTable dt = operation.GetOutTimeDocInfo(strWhere, dtpStartTime.Value.ToShortDateString(), dtpEndTime.Value.ToShortDateString());
SetStatisticalTable(dt); double[] arrvalues = new double[dt.Rows.Count];
Color[] colors = new Color[dt.Rows.Count];
for (int j = 0; j < dt.Rows.Count; j++)
{
names[j] = dt.Rows[j]["deptname"].ToString();
string count = "0"; if (dt.Rows[j]["doccount"].ToString() != "")
{
count = dt.Rows[j]["doccount"].ToString();
}
arrvalues[j] = double.Parse(count);
colors[j] = GetColor();
} bindStat(arrvalues, names, colors);
}