Search code examples
c#.netdundas

How do I add labels to a Dundas Chart?


How to add labels to my graphs to indicate which series is what.

My clients don't want legends, they want the labels on the chart area. Possibly with C#?


Solution

  • The easiest way to set labels is when you bind your data to the chart.

    Eg. for a piechart (may be different on other types):

    chart.Series["seriesName"].Points.DataBind(MyDataList, "xFieldPropertyName", "yFieldPropertyName", "Label=xFieldPropertyName{p2},LegendText=legendPropertyName");