Re: Are there any easy methods to draw and update piechart than this?
- From: Tristan Van Berkom <vantr touchtunes com>
- To: praveen manja <praveen_manja rediffmail com>
- Cc: gtk-list gnome org, gtk-app-devel-list gnome org, gnome-devel-list gnome org
- Subject: Re: Are there any easy methods to draw and update piechart than this?
- Date: Wed, 21 May 2003 09:26:26 -0400
This function:
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Drawing-Primitives.html#gdk-draw-arc
could be used.
praveen manja wrote:
Hi Gnomites,
Please let me know if there are there any easy methods to draw and
update piechart than this.
I am developing a cluster management tool along with dynamic resource
monitoring component.
In GUI I have developed dynamically updated piecharts and barcharts
to show sys-resources.(as you can see process bars in GTOP) .
I didn't use GnomeCanvasEllipse to draw the piechart, as the whole
ellipse has to be filled by a single color. But I need different
colors to be filled amongst the units of the piechart.
(Eg. In a piechart showing meminfo, I need green for Memfree and
orange for Mem used.)
Hence I was forced to use 360 isosceles triangles with :
length of a, b (of equal sides) = radius,
length of c = 1 unit (converted to canvas unit)
angle = 1 deg (converted to radian)
Using the above info I iterated a loop to draw 360 polygons(triangle)
and later I updated the polygon points using
gtk_timeout_add()
and
gnome_canvas_item_set() in my callback to set the new
color of the already created triangle .
It is workin fine.
Please let me know if there are there any easy methods to draw and
update piechart than this.
Thanks,
Praveen S Manja.
___________________________________________________
Impress your clients! Send mail from me @ mycompany.com .
Just Rs.1499/year.
Click http://www.rediffmailpro.com to know more.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]