Skip to content

Question: Why is there no ToPlot PlotBars #245

@petercoppensdatylon

Description

@petercoppensdatylon

Hello,

I am new to Haskell in general and certainly to the Haskell Chart package.

While learning I was trying to change example 1 to render a barchart. But I run into the fact that there seems not be an instance of ToPlot for PlotBars.

E.g. code below gives a compile error: No instance for (ToPlot PlotBars) arising from a use of ‘plot’

`
bvals :: [(String, [Double])]
bvals = [ ("b1", [61]),("b2", [22]),("b3", [42]),("b4", [32]),("b5", [1])]

pb3 :: EC (Layout PlotIndex Double) ()
pb3 = do
let dd = addIndexes (bvals ^.. traverse . _2)
let xx = bars [ "Title"] dd
plot xx

`

I can create a barchart in other ways following other examples, but I was wondering whether there is a reason for this missing instance or just something that was not implemented (yet)

Tx!

Peter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions