views:

57

answers:

1

i have a pie chart but i am not able to put a hyperlink on that chart.

i have put an on-click event to navigate to a new page but that also does not work..

please suggest.. thanks..

my code: HTML

 <asp:Chart ID="Chart1" runat="server" Height="252px" onclick="Chart1_Click">
            <Series>
        <asp:Series ChartType="Pie" Name="Series1" >
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
        </asp:ChartArea>
    </ChartAreas>
        </asp:Chart>

code behind

 protected void Chart1_Click(object sender, ImageMapEventArgs e)
    {
        Response.Redirect("~/Reports.aspx");
+1  A: 

You could set the Url value in series. So it will be:

<asp:Series ChartType="Pie" Name="Series1" Url="~/Reports.aspx">
 </asp:Series>
MSwehli