[undocumented]
make-bar-chart [#:title = #f] [#:data = #f] [#:write-to-png = #f] [#:bar-width = 40] [#:group-spacing = 40] [#:chart-height = 360] [#:chart-params = (quote ())] [#:legend-params = (quote ())] | [Function] |
Make a bar chart.
The format of data is defined as follows:
(group+)
(group-label bar+)
A string, to be written to the X axis.
(height bar-params?)
The bar height, as a number.
A property list suitable to passing to charting draw draw-bar.
This function returns the cairo surface. By default, make-chart will create an image surface, but you may override this by passing a :make-surface function in the chart-params. In this way you can render charts to any surface supported by Cairo, e.g. PS, PDF, SVG, GDK, etc.
The :write-to-png option will write the chart out to the PNG file that you name.
An example invocation might look like:
(make-bar-chart "Average Height at Iihenda JSS"
'(("Grade 9" (150 "Boys") (140 "Girls"))
("Grade 10" (150 "Boys")
(140 "Girls" (:y+-bracket 5 :y--bracket 4.5))))
:write-to-png "/tmp/graph.png") make-chart [#:title = #f] [#:chart-height = 360] [#:chart-width = 360] [#:font-family = "Bitstream Vera Sans"] [#:line-width = 1] [#:title-text-height = 16] [#:axis-text-height = 12] [#:x-axis-label = #f] [#:y-axis-label = #f] [#:tick-size = 5] [#:y-axis-ticks = #f] [#:x-axis-ticks = #f] [#:y-axis-tick-labels = #f] [#:x-axis-tick-labels = #f] [#:chart-margin = 5] [#:margin = 5] [#:make-surface = (lambda (x y) (cairo-image-surface-create (quote argb32) x y))] | [Function] |
Make a chart.
tick-lables is an alist of label-value pairs, where the value is given in chart height coordinates. The label can be #f.
This function makes the basic chart, setting up the basics like the title, axes, etc. You probably don't want to call this unless you are making a custom chart type.
This function returns a cairo context whose coordinate system has been flipped so that the origin of the chart is (0, 0), with positive in the northeast quadrant.