//产生数据库数据 DataSet ds = new DataSet(); SqlConnection con = new SqlConnection(@"server=XINGSQLEXPRESS;database=Test;uid=sa;pwd=123456"); SqlCommand cmd = new SqlCommand("select Name,Money from test", con); SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = cmd; con.Open(); cmd.ExecuteNonQuery(); sda.Fill(ds, "test"); con.Close(); //绘制柱状图表 Infragistics.UltraChart.Resources.Util.DemoSetup(this.UltraChart1); this.UltraChart1.DataSource = ds.Tables["test"]; this.UltraChart1.DataBind(); this.UltraChart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.ColumnChart; this.UltraChart1.Legend.Visible = true; this.UltraChart1.Axis.X.Labels.Orientation = this.UltraChart1.Axis.Y.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Custom; this.UltraChart1.TitleTop.Text = "UltraChart演示程序"; this.UltraChart1.Tooltips.FormatString = "<font size=-1>Money:$<DATA_VALUE:00.00><BR>Item:<ITEM_LABEL>";// //鼠标悬停有提示,非常精美!