Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Why is there no ToPlot PlotBars #245

Open
petercoppensdatylon opened this issue Jan 8, 2023 · 0 comments
Open

Question: Why is there no ToPlot PlotBars #245

petercoppensdatylon opened this issue Jan 8, 2023 · 0 comments

Comments

@petercoppensdatylon
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant