After tried your solution, chart is not visible.
Here is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using Syncfusion.Windows.Forms.Chart;
namespace WebApplication25
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
chartss();
}
public void chartss()
{
ChartDataBindModel model1 = null;
SqlConnection connection = new SqlConnection(@"Server=####; Database=@@@@; User Id=%%; password=!!!!");
SqlCommand command = new SqlCommand("select ROW_NUMBER() over(order by AC.Description) as Id, Count(*) as Total from ReqDetail rd inner join ReqHead rh on rd.Company =rh.Company and rd.ReqNum = rh.ReqNum inner join Part P on rd.Company=P.Company and rd.PartNum=P.PartNum inner join AnalysisCd AC on P.Company=AC.Company and P.Mtl_AnalysisCode=AC.AnalysisCode where rh.OpenReq =1 and rh.company='COMP01' group by AC.Description,AC.AnalysisCode having Count(*)> 11 ", connection);
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataTable dt = new DataTable("ChartSeries");
adapter.Fill(dt);
//Binding data in data table to a data binding model
model1 = new ChartDataBindModel(dt);
//Binding a column of data table to x name
model1.XName = "Id";
//Binding a column of data table with y names
model1.YNames = new string[] { "Total" };
ChartSeries series = new ChartSeries("Data Binding");
series.Type = ChartSeriesType.Pie;
//Binding model with series
series.SeriesModel = model1;
ChartWebControl1.Series.Add(series);
}
}
}