0

I am using asp.net charts in my web application. All the data points are clickable. I used MapAreaAttributes of each point to call a javascript function "onclick" event.

I want to change the cursor to pointer on mouse over event of the data points. I tried:

chart.Series["series"].Points[i].MapAreaAttributes += "onmouseover=\"this.style.cursor='pointer'\" onmouseout=\"this.style.cursor='default'\"";

but it doesn't work.

Anyone has a solution for that?

Thanks in advance for your help,

Inbal

Inbal
  • 909
  • 2
  • 28
  • 46

1 Answers1

0

You need to do this in prepaint event . As I have done it for my custom tooltip by calling javascript method onmouseover

<asp:Chart ID="ChartEXCEL" OnPrePaint="ChartEXCEL_Load" ClientIDMode="Static" Width="300px" Height="200px" runat="server">

protected void Chart1_Load(object sender, ChartPaintEventArgs e)
{
    if (e.ChartElement is Series)
    {

        Series series = (Series)e.ChartElement;
        System.Drawing.PointF position = System.Drawing.PointF.Empty;


        series.MapAreaAttributes = "onmouseover=\"showTooltip('#VALY-#VALX');\"";


    }
}