求救,如何生成柱状图,拆线图等统计图? 目前要做一个类似网上调查的项目,然后根据调查得到的数据进行分析,最后生成相关的曲线图表,还要支持打印...没有做过,大家帮帮我,用什么做?或者给我提供些资料吧...顶者有分.. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我觉得用RDLC报表做比较好一些 http://blog.csdn.net/luck0235/archive/2007/01/22/1490258.aspx http://www.yesky.com/20030324/1658705.shtml NetAdvantage 2006使用这个第三方控件很简单他有一百多种图形可以调用 office的owc好用又听漂亮的try!! http://blog.csdn.net/nyzfl/archive/2007/03/06/1521898.aspx http://www.wave12.com/web/home.asp 图表组件wsChart4.6(DLL版) try..ZedGraph..WinForm下应用请参见:http://www.codeproject.com/csharp/ZedGraph.aspWebForm下应用请参见:http://zedgraph.org/wiki/index.php?title=Use_a_MasterPane_in_a_web_pagehttp://zedgraph.org/wiki/index.php?title=Use_RenderMode.ImageTag_in_a_web_pagehttp://zedgraph.org/wiki/index.php?title=Use_RenderMode.RawImage_in_a_web_page另外给你一个以前自己学的时候写的一个小例子:public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { CreateGraph(this.zedGraphControl1); SetSize(); } private void CreateGraph(ZedGraphControl zgc) { MasterPane master = zgc.MasterPane; master.PaneList.Clear(); master.Title.Text = "学生个体学习特点分析"; master.Title.IsVisible = true; master.Fill = new Fill(Color.White, Color.MediumSlateBlue, 45.0F); master.Margin.All = 10; master.InnerPaneGap = 10; master.Legend.Position = ZedGraph.LegendPos.TopCenter; //添加学习策略整体比较图 GraphPane pane = new GraphPane(); pane.Title.Text = "**同学的学习策略整体比较图"; pane.XAxis.Title.Text = "学习策略"; pane.YAxis.Title.Text = "百分数"; pane.YAxis.MajorGrid.IsVisible = true; pane.XAxis.Type = AxisType.Text; pane.YAxis.Scale.Min = 0; pane.YAxis.Scale.Max = 120; string[] lables = new string[] { "预\n习\n策\n略", "听\n讲\n策\n略", "复\n习\n策\n略", "作\n业\n策\n略", "总\n结\n策\n略", "阅\n读\n策\n略", "时\n效\n策\n略", "记\n忆\n策\n略", "创\n新\n策\n略" }; double[] scores = new double[] { 45.67, 56.89, 90.45, 48.29, 60.45, 45.67, 40.34, 87.65, 67.48 }; LineItem line = pane.AddCurve("你的学习策略", null, scores, Color.Red, SymbolType.Square); line.Symbol.Fill = new Fill(Color.Gray); pane.XAxis.Scale.TextLabels = lables; pane.Chart.Fill = new Fill(Color.White, Color.SteelBlue, 45.0f); pane.Legend.Position = ZedGraph.LegendPos.TopCenter; master.Add(pane); //增加学习压力和自我调节图 pane = new GraphPane(); pane.Title.Text = "**同学的学习压力与自我调节图"; pane.XAxis.Title.Text = "百分数"; pane.XAxis.MajorGrid.IsVisible = true; pane.XAxis.Scale.Min = 0; pane.XAxis.Scale.Max = 100; pane.YAxis.Title.IsVisible = false; string[] ylables = new string[] { "自我调节", "学习压力" }; double[] x = new double[] { 38, 73 }; BarItem bar = pane.AddBar("", x, null, Color.Red); bar.Bar.Fill = new Fill(Color.White, Color.Red, 90.0F); pane.YAxis.MajorTic.IsBetweenLabels = true; pane.YAxis.Scale.TextLabels = ylables; pane.YAxis.Type = AxisType.Text; pane.BarSettings.Base = BarBase.Y; pane.BarSettings.Type = BarType.Stack; pane.Chart.Fill = new Fill(Color.White, Color.FromArgb(255, 255, 166), 45f); //给柱形图加上标签 //设置lable与柱形图的间距 float offset =(float ) (pane.XAxis.Scale.Max - pane.XAxis.Scale.Min) * 0.02f; ValueHandler valueHandler = new ValueHandler(pane, true); int curveIndex=0; foreach (CurveItem curve in pane.CurveList) { BarItem barItem = curve as BarItem; if (bar != null) { IPointList points = curve.Points; for (int i = 0; i < points.Count; i++) { double baseVal, lowVal, HighVal; valueHandler.GetValues(curve, i, out baseVal, out lowVal,out HighVal); float centerVal = (float)valueHandler.BarCenterValue(bar, bar.GetBarWidth(pane), i, baseVal, curveIndex); string barLabelText = points[i].X .ToString("0.00"); float position = (float)HighVal + offset; TextObj label = new TextObj(barLabelText, position, centerVal); label.Location.CoordinateFrame = CoordType.AxisXYScale; label.FontSpec.Size = 12; label.FontSpec.FontColor = Color.Black; label.FontSpec.Angle = 0; label.Location.AlignH = AlignH.Left; label.Location.AlignV = AlignV.Center; label.FontSpec.Border.IsVisible = false; label.FontSpec.Fill.IsVisible = false; pane.GraphObjList.Add(label); } } curveIndex++; } master.Add(pane); //设置不允许滚动 this.zedGraphControl1.IsEnableHZoom = false; this.zedGraphControl1.IsEnableVZoom = false; //显示节点的值 this.zedGraphControl1.IsShowPointValues = true; this.zedGraphControl1.PointValueEvent += new ZedGraphControl.PointValueHandler(zedGraphControl1_PointValueEvent); //设置layout using (Graphics g = this.zedGraphControl1.CreateGraphics()) { master.SetLayout(g, PaneLayout.SingleColumn); master.AxisChange(g); } } string zedGraphControl1_PointValueEvent(ZedGraphControl sender, GraphPane pane, CurveItem curve, int iPt) { //如果是Bar if (curve.IsBar) { return pane.YAxis.Scale.TextLabels[iPt] + ":" + curve.Points[iPt].X.ToString() + "%"; } else if (curve.IsLine) { return pane.XAxis.Scale.TextLabels[iPt].Replace ("\n","") + ":" + curve.Points[iPt].Y.ToString() + "%"; } else return ""; } private void Form1_Resize(object sender, EventArgs e) { SetSize(); } private void SetSize() { this.zedGraphControl1.Location = new Point(10, 10); this.zedGraphControl1.Size = new Size(ClientRectangle.Width - 20, ClientRectangle.Height - 20); } } 1,ZedGraph2,owc3,自己画 ASP.NET2.0轻松搞定统计图表【月儿原创】 http://blog.csdn.net/21aspnet/archive/2007/03/27/1543320.aspx 给你来个全的18个WebChart生成各种曲线/柱状图C#源码 http://www.51aspx.com/CV/WebChart/下面有代码佩文 我是用vml画的。感觉还是挺好用的。http://www.microsystem.cn/vmlChart/ 使用服务器控件后Jquery找不到img了 asp.net c# 操作pdf 浏览器地址栏怎么隐藏不了? dropdownlist 选取值问题 请教! 如何实现实时播放一个正在录制的音频文件? asp.net新闻后台怎样对字体和颜色改变, asp.net上传excel,怎么判断excel内容是否重复 Asp.net的初级问题,已经困了几天了,请高手帮忙,多谢。(之前发的帖不清楚) 如何获取DataGrid的某单元格的内容,请帮忙,急!! FCKeditor_2.5在vs2005里面怎么用啊 如何配置啊? asp.net 对象之间的引用 求-时间控件
很简单
他有一百多种图形可以调用
好用又听漂亮的
try!!
图表组件wsChart4.6(DLL版)
http://zedgraph.org/wiki/index.php?title=Use_a_MasterPane_in_a_web_page
http://zedgraph.org/wiki/index.php?title=Use_RenderMode.ImageTag_in_a_web_page
http://zedgraph.org/wiki/index.php?title=Use_RenderMode.RawImage_in_a_web_page另外给你一个以前自己学的时候写的一个小例子:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{
CreateGraph(this.zedGraphControl1);
SetSize();
}
private void CreateGraph(ZedGraphControl zgc)
{
MasterPane master = zgc.MasterPane;
master.PaneList.Clear();
master.Title.Text = "学生个体学习特点分析";
master.Title.IsVisible = true;
master.Fill = new Fill(Color.White, Color.MediumSlateBlue, 45.0F);
master.Margin.All = 10;
master.InnerPaneGap = 10;
master.Legend.Position = ZedGraph.LegendPos.TopCenter; //添加学习策略整体比较图
GraphPane pane = new GraphPane();
pane.Title.Text = "**同学的学习策略整体比较图";
pane.XAxis.Title.Text = "学习策略";
pane.YAxis.Title.Text = "百分数";
pane.YAxis.MajorGrid.IsVisible = true;
pane.XAxis.Type = AxisType.Text;
pane.YAxis.Scale.Min = 0;
pane.YAxis.Scale.Max = 120;
string[] lables = new string[] { "预\n习\n策\n略", "听\n讲\n策\n略", "复\n习\n策\n略", "作\n业\n策\n略", "总\n结\n策\n略", "阅\n读\n策\n略", "时\n效\n策\n略", "记\n忆\n策\n略", "创\n新\n策\n略" };
double[] scores = new double[] { 45.67, 56.89, 90.45, 48.29, 60.45, 45.67, 40.34, 87.65, 67.48 };
LineItem line = pane.AddCurve("你的学习策略", null, scores, Color.Red, SymbolType.Square);
line.Symbol.Fill = new Fill(Color.Gray);
pane.XAxis.Scale.TextLabels = lables;
pane.Chart.Fill = new Fill(Color.White, Color.SteelBlue, 45.0f);
pane.Legend.Position = ZedGraph.LegendPos.TopCenter;
master.Add(pane); //增加学习压力和自我调节图
pane = new GraphPane();
pane.Title.Text = "**同学的学习压力与自我调节图";
pane.XAxis.Title.Text = "百分数";
pane.XAxis.MajorGrid.IsVisible = true;
pane.XAxis.Scale.Min = 0;
pane.XAxis.Scale.Max = 100;
pane.YAxis.Title.IsVisible = false;
string[] ylables = new string[] { "自我调节", "学习压力" };
double[] x = new double[] { 38, 73 };
BarItem bar = pane.AddBar("", x, null, Color.Red);
bar.Bar.Fill = new Fill(Color.White, Color.Red, 90.0F);
pane.YAxis.MajorTic.IsBetweenLabels = true;
pane.YAxis.Scale.TextLabels = ylables;
pane.YAxis.Type = AxisType.Text;
pane.BarSettings.Base = BarBase.Y;
pane.BarSettings.Type = BarType.Stack;
pane.Chart.Fill = new Fill(Color.White, Color.FromArgb(255, 255, 166), 45f);
//给柱形图加上标签
//设置lable与柱形图的间距
float offset =(float ) (pane.XAxis.Scale.Max - pane.XAxis.Scale.Min) * 0.02f;
ValueHandler valueHandler = new ValueHandler(pane, true);
int curveIndex=0;
foreach (CurveItem curve in pane.CurveList)
{
BarItem barItem = curve as BarItem;
if (bar != null)
{
IPointList points = curve.Points;
for (int i = 0; i < points.Count; i++)
{
double baseVal, lowVal, HighVal;
valueHandler.GetValues(curve, i, out baseVal, out lowVal,out HighVal);
float centerVal = (float)valueHandler.BarCenterValue(bar, bar.GetBarWidth(pane), i, baseVal, curveIndex);
string barLabelText = points[i].X .ToString("0.00");
float position = (float)HighVal + offset;
TextObj label = new TextObj(barLabelText, position, centerVal);
label.Location.CoordinateFrame = CoordType.AxisXYScale;
label.FontSpec.Size = 12;
label.FontSpec.FontColor = Color.Black;
label.FontSpec.Angle = 0;
label.Location.AlignH = AlignH.Left;
label.Location.AlignV = AlignV.Center;
label.FontSpec.Border.IsVisible = false;
label.FontSpec.Fill.IsVisible = false;
pane.GraphObjList.Add(label);
}
}
curveIndex++;
}
master.Add(pane); //设置不允许滚动
this.zedGraphControl1.IsEnableHZoom = false;
this.zedGraphControl1.IsEnableVZoom = false; //显示节点的值
this.zedGraphControl1.IsShowPointValues = true;
this.zedGraphControl1.PointValueEvent += new ZedGraphControl.PointValueHandler(zedGraphControl1_PointValueEvent); //设置layout
using (Graphics g = this.zedGraphControl1.CreateGraphics())
{
master.SetLayout(g, PaneLayout.SingleColumn);
master.AxisChange(g);
}
} string zedGraphControl1_PointValueEvent(ZedGraphControl sender, GraphPane pane, CurveItem curve, int iPt)
{
//如果是Bar
if (curve.IsBar)
{
return pane.YAxis.Scale.TextLabels[iPt] + ":" + curve.Points[iPt].X.ToString() + "%";
}
else if (curve.IsLine)
{
return pane.XAxis.Scale.TextLabels[iPt].Replace ("\n","") + ":" + curve.Points[iPt].Y.ToString() + "%";
}
else
return "";
} private void Form1_Resize(object sender, EventArgs e)
{
SetSize();
}
private void SetSize()
{
this.zedGraphControl1.Location = new Point(10, 10);
this.zedGraphControl1.Size = new Size(ClientRectangle.Width - 20, ClientRectangle.Height - 20);
}
}
2,owc
3,自己画
http://blog.csdn.net/21aspnet/archive/2007/03/27/1543320.aspx
http://www.microsystem.cn/vmlChart/