• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A pie analyzer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A pie analyzer


  • Subject: Re: A pie analyzer
  • From: Shaun Wexler <email@hidden>
  • Date: Sat, 19 Apr 2003 12:03:30 -0700

On Saturday, April 19, 2003, at 09:18 AM, Tony S. Wu wrote:

I am working on a "pie" analyzer, which takes number and present them in percentage with a pie graph.

http://homepage.mac.com/tonyswu/temp/c2.gif

I've got pretty much everything figured out, but I'd like to add a tooltip to each of the pie, so when users move the mouse over it'll show more info, like this:

http://homepage.mac.com/tonyswu/temp/c1.gif

My problem is, NSView only allows me to add tooltip for a rect.
I thought about using NSBezierPath's containsPoint method.
But I am not sure if it's a good idea since i'll be calling this method for average 5 to 8 times each time a user moves his mouse.
Can someone give me some ideas?

If the mouse is within the overall pie rect, test the color of the pixel under the mouse, and match that against the graph colors. There will be some anti-alias blending and thus you won't receive identical values for pixels on the edges, but if you throw away some of the LS bits of each color component, and then round, it should be fairly accurate.

--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >A pie analyzer (From: "Tony S. Wu" <email@hidden>)

  • Prev by Date: Re: Custom handling for 'odoc' events
  • Next by Date: Mount Disk Images programmatically with password
  • Previous by thread: A pie analyzer
  • Next by thread: Re: A pie analyzer
  • Index(es):
    • Date
    • Thread