Hello,
I just started using the Infragistics tool, and I have to create an UltraChart and information from a SQL DB has to be displayed on the chart. Now I'm not sure how to bind the data from the Sql table to the chart and then display that chart on a .aspx webpage when a link is clicked.
I am using Microsoft Visual Studio 2008 and NetAdvantage for .Net Vol1 CLR 3.5 with Microsoft Sql Server.
I have used this code in the .vb file......What am I missing? The chart is on the .aspx page in a form, tables are used.
UltraChart1.DataSourceID = Infragistics.UltraChart.Data.DemoTable.Table
UltraChart1.DataBind()
End Sub
In .aspx file this is code generated by the chart, is something missing here?
<igchart:UltraChart ID="UltraChart1" runat="server" BackgroundImageFileName=""
A quick response will be greatly appreciated.
Thanks!
Once you have created a dataset and filled it with sql data, do the following:UltraChart1.Data.DataSource = myDataSet.Tables("myTable")UltraChart1.Data.DataBind()
Hi,
The following is my coding
UltraChart ultrachart1 = new UltraChart(); ultrachart1.Parent = this; ultrachart1 .Location = new Point (20,20); ultrachart1.Size = new Size(800,700);
SqlConnection con = new SqlConnection("Server=xxx;DataBase = xxxx;Uid=xx;Pwd=xx;"); SqlCommand StrCmd3 = new SqlCommand("Select * From xxx", con); SqlDataAdapter StrAdp3 = new SqlDataAdapter(StrCmd3); DataSet StrDs3 = new DataSet(); StrAdp3.Fill(StrDs3); ultraChart2.DataSource = StrDs3; ultraChart2.DataBind();
I am getting the display but the chart does not shows the data label values on the chart. how to display the data value on each column. kindly go through my coding above and provide me the solution.
Thanks in advance.
You have to add a chart text appearance to your chart if you want to see data labels for each column:
ChartTextAppearance chartTextAppearance = new ChartTextAppearance();chartTextAppearance.ItemFormatString = "<DATA_VALUE>";chartTextAppearance.Visible = true;chartTextAppearance.Row = -2;chartTextAppearance.Column = -2;ultraChart1.ColumnChart.ChartText.Add(chartTextAppearance);
Thank you very much, it works perfectly.
Thillai.