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

How to put a PieChart or PieLayout in a Grid? #217

Open
cblp opened this issue Jun 3, 2020 · 3 comments
Open

How to put a PieChart or PieLayout in a Grid? #217

cblp opened this issue Jun 3, 2020 · 3 comments

Comments

@cblp
Copy link

cblp commented Jun 3, 2020

I need to draw a pie chart beside a simple plot on a single canvas.

@cblp
Copy link
Author

cblp commented Jun 3, 2020

I tried tval . pieToRenderable, but cannot unify LayoutPick and PickFn

@cblp
Copy link
Author

cblp commented Jun 3, 2020

I managed to draw a pie beside a plot with help of #218 and [1], but it looks like this:

[ pie ][      ]
[     ][ plot ]

while I expect

[ pie ][ plot ]

[1]:

-- | Generalize LayoutPick to PickFn under Grid.
layoutToGrid' ::
    (Ord x, Ord y) =>
    Layout x y -> Grid (Renderable (PickFn (LayoutPick x y y)))
layoutToGrid' = fmap (fmap (const . Just)) . layoutToGrid

@cblp
Copy link
Author

cblp commented Aug 31, 2021

  • pie `above` plot
  • pie `beside` plot
  • pie `overlay` plot

all give the same result:

[ pie ][      ]
[     ][ plot ]

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