[Chart] layout1_plots ordinate types

Tim Docker tim at dockerz.net
Thu May 31 14:37:28 BST 2012

Hi Ben,

Yes. Depending on the value of layout1_yaxes_control, the value
associated with one axis may be duplicated on the other side. So
the types of the left and right axes need to be the same.

But, I think things would be a little cleaner and simpler, if
there were two different layouts:

     one which had a single y axis, and an enumeration to decide if
     the axis is to be shown on the left/right/both sides.

     one which had independent y axes with different types.

ie something like:

data Layout1 x y = Layout1 {
     layout1_plots_           :: [(Plot x y)],

data Layout1LR x y1 y2 = Layout1 {
     layout1lr_plots_           :: [Either (Plot x y1) (Plot x y2)],


On 30/05/12 23:05, Ben Gamari wrote:
> Is there a reason why layout1_plots :: [Either (Plot x y) (Plot x y)]
> enforces that both left and right axes have the same y type? I recently
> encountered a situation where I wanted to plot both Int and Float
> ordinates on the same plot. Unfortunately, I was unable to do this due
> to this limitation.

More information about the Chart mailing list