1
Answer

bar chart not displaying

john kanyora

john kanyora

7y
145
1
Hi, kindly asking for help.Am using ajax toolkit to draw a bar chart from the database but once i run my web page it does not display..the problem is on the line code i have highlighted in red...help me wat to set to make it visible..
this is my code;
public void BindGrid()
{
string query = "select Customer, COUNT([Total Amount]) [Total Amount] from CustomerDebts group by Customer";
DataTable dt = GetData(query);

string[] x = new string[dt.Rows.Count];
decimal[] y = new decimal[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
x[i] = dt.Rows[i][0].ToString();
y[i] = Convert.ToInt32(dt.Rows[i][1]);
}
BarChart1.Series.Add(new AjaxControlToolkit.BarChartSeries { Data = y });
BarChart1.CategoriesAxis = string.Join(",", x);
if (x.Length > 3)
{
BarChart1.ChartWidth = (x.Length * 150).ToString();
}
BarChart1.Visible=  


}
private static DataTable GetData(string query)
{
DataTable dt = new DataTable();
string constr = TraceBizCommon.Configuration.ConfigSettings.ConnectionString;
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(query))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
sda.SelectCommand = cmd;
sda.Fill(dt);
}
}
return dt;
}
Answers (1)
0
Kirtan Patel

Kirtan Patel

NA 35k 2.8m 14y
'this' is Pointer not operator ..

by operator overloading mechanism you can overload operators only not the pointers



Here is list of operator that is over loadable ...

+ - * / % ^ & | ~
! , = < > <= >= ++ --
<< >> == != && || += -= /=
%= ^= &= |= *= <<= >>= [] ()
-> ->* new new[] delete delete[]