-
Notifications
You must be signed in to change notification settings - Fork 86
example 5
Tim Docker edited this page May 20, 2013
·
9 revisions
This chart:
was produced by this code:
import Graphics.Rendering.Chart
import Graphics.Rendering.Chart.Gtk
import Data.Accessor
chart = layout
where
values = [ ("Mexico City",19.2,e), ("Mumbai",12.9,e), ("Sydney",4.3,e), ("London",8.3,e), ("New York",8.2,e1) ]
e = 0
e1 = 25
pitem (s,v,o) = defaultPieItem{pitem_value_=v,pitem_label_=s,pitem_offset_=o}
layout = pie_title ^= "Relative Population"
$ pie_plot ^: pie_data ^= map pitem values
$ defaultPieLayout
main = do
renderableToWindow (toRenderable chart) 640 480
renderableToPNGFile (toRenderable chart) 640 480 "test.png"