I would like to customize the labels on the datapoints below so they would render as (using first datapoint on the chart as an example) :
4:10 - 4:40 yellow class
Datapoint has a label property that can be set programatically:
DataPoint dp = new DataPoint();
dp.Label = c.Start.ToShortTimeString() + " - " + c.End.ToShortTimeString() + "\n" + c.Class;
You can iterate through the datapoints in a series after databinding:
foreach (DataPoint d in Chart1.Series[0].Points)
{
d.Label = "somevalue";
}
Or you can set the values when you databind:
Chart1.Series[0].Points.DataBind(datasource, "xField", "yField", "Label={somevalue}");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.