Hello friends...
i am doing ajax pie chart report getting data from database..Here the problem is i want change the color of the pie chart from .cs file..(Actually It is only adding some color to pie chart But I want to add my own color to pie chart)...
.cs code:
namespace WebApplication65
{
public partial class WebForm2 : System.Web.UI.Page
{
SqlConnection conn = new SqlConnection("server=ADMIN-PC\\SQLEXPRESS;database=rama;integrated security=true");
protected void Page_Load(object sender, EventArgs e)
{
data();
}
public void data()
{
SqlCommand cmd = new SqlCommand("select * from countrydetails", conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
foreach (DataRow row in ds.Tables[0].Rows)
{
PieChart1.PieChartValues.Add(new AjaxControlToolkit.PieChartValue
{
// PieChartValueColor = "#00b0f0",
// PieChartValueStrokeColor = "#676767",
Category = row["name"].ToString(),
Data = Convert.ToDecimal(row["value"])
});
}
}
}
}
source code:
html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<cc1:PieChart ID="PieChart1" runat="server" >
<piechartvalues>
</form>
</body>
</html>