Hi Andrew,
It is not possible to wrap an anchor around a Donut series, but you can handle the OnSeriesClick event and navigate to the desired URL depending on the series.name/series.data.
For example, you can keep the desired urls into an additional dataField in the passed data source in a similar way:
<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="600">
<ClientEvents OnSeriesClick="onSeriesClick" />
<PlotArea>
<Series>
<telerik:DonutSeries DataFieldY="valueField" NameField="nameField">
</telerik:DonutSeries>
</Series>
</PlotArea>
</telerik:RadHtmlChart>
<script>
function onSeriesClick(e) {
var url = e.dataItem.urlField;
window.location.href = url;
}
</script>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
RadHtmlChart1.DataSource = GetData();
RadHtmlChart1.DataBind();
}
}
private DataTable GetData()
{
DataTable dt = new DataTable();
dt.Columns.Add("valueField");
dt.Columns.Add("nameField");
dt.Columns.Add("urlField");
dt.Rows.Add(30, "google", "http://google.com");
dt.Rows.Add(10, "bing", "http://bing.com");
dt.Rows.Add(50, "bing", "http://msn.com");
return dt;
}
Regards,
Vessy
Progress Telerik
Get
quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.
Learn More.