Skip to content

Frequently Asked Questions

Tim Docker edited this page Mar 2, 2016 · 5 revisions

1. How can I customize a chart?

The Layout data type captures all the information about a chart, so understanding it (and its contained values) is key to controlling the visual appearance of a chart. The repo contains an example script that shows some of the customizations that can be made.

2. How do I manually specify the range of a chart?

Each axis has a generator (of type AxisFn a) that builds the axis based upon the points plotted against that axis. The default generator is autoScaledAxis and automatically scales the axis to have a range large enough to show all of the points. You can override the default generator to use scaledAxis, and specify the range explicitly:

chart = do
    layout_y_axis . laxis_generate .= scaledAxis def (-10,80)
    ...

3. How do I render more than one chart on a page?

There are two mechanisms for this:

The StackedLayouts type represents a vertical stack of charts (ie 1xN) all with a consistent x axis type and range. An example of its use can be found in the test suite.

Alternatively, an arbitrary collection of charts of any type can be displayed in a grid. See the example elsewhere in the wiki.

Clone this wiki locally