i m using c# for first time in a asp.net website, in which i am creating charts. i have created a column chart- 2D, and the code goes like this,
protected void chrtTickets_Load(object sender, EventArgs e)
{
using (SqlConnection connection = new SqlConnection(ConnectionString))
{
connection.Open();
SqlCommand cmmd6 = new SqlCommand("getHowTicketsLoggedChart", connection);
cmmd6.CommandType = CommandType.StoredProcedure;
DataSet ds1 = new DataSet();
SqlDataAdapter dad = new SqlDataAdapter(cmmd6);
dad.Fill(ds1);
chrtTickets.DataSource = ds1;
chrtTickets.Series["Series1"].XValueMember = "MonYYYY";
chrtTickets.Series["Series1"].YValueMembers = "aa";
chrtTickets.DataBind();
connection.Close();
}
}
but i have the stored procedure which returns me another field "Description" along with MonYYYy and aa as they are used in xaxis and yaxis.
but according to the "description" field value say: email, phone, portal. i want to assign a different color to each column depending upon each row's description value, if its Email-> red and so on etc.
can anyone please guide me through this?
what i mean is my data will be be like this: so i will not know what will be color type value in advance, this is the table values returned to me from db by my stored procedure.
color type| y-axiz value | x-axis
Email Connector| 24| Dec 2011 Phone | 32 | Dec 2011 Email Connector |643 | Jan 2012 Internal | 32 | Jan 2012 Phone |455| Jan 2012 Portal |2 | Jan 2012 Sales Order| 2| Jan 2012
it cold be one of the 5 types ex. email, portal but many x-axis value.
datapoints will not be known. they are dynamic.