Set Hand Cursor for Legend Item


Author
Message
Alexander Haberl
Alexander Haberl
Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)Forum Newbie (8 reputation)
Group: Forum Members
Posts: 15, Visits: 48
I cannot set a Hand Cursor for an automatic LegendItem. Is this possible?

I tried this approach (the changing of the Font to an underlined Font works):

 
  private void ChartControl_MouseMove(object sender, MouseEventArgs e)
   {
    NHitTestResult res = null;

    try
    {
      res = HitTest(e.X, e.Y);
    }
    catch (Exception)
    {

    }

    if (null != res)
    {
      if (res.ChartElement == ChartElement.LegendDataItem)
      {
       for (int i = 0; i < Charts.Count; i++)
       {
        foreach (NSeriesBase s in Charts[i].Series)
        {
          NSeriesLegend seriesLegend = s.Legend;
          seriesLegend.TextStyle.FontStyle.Style = FontStyle.Regular;
        }
       }

       res.LegendDataItem.TextStyle.FontStyle.Style = FontStyle.Underline;

       res.LegendDataItem.InteractivityStyle.Cursor.Type = CursorType.Hand;

       resetLegend = true;

       Refresh();
      }
      else
      {
       if (resetLegend)
       {
        for (int i = 0; i < Charts.Count; i++)
        {
          foreach (NSeriesBase s in Charts[i].Series)
          {
           NSeriesLegend seriesLegend = s.Legend;
           seriesLegend.TextStyle.FontStyle.Style = FontStyle.Regular;
          }
        }

        Refresh();
        resetLegend = false;
       }
      }
    }
   }


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search