kristw edited a comment on issue #5758: [SIP-5] Refactor and improve histogram URL: https://github.com/apache/incubator-superset/pull/5758#issuecomment-417402019 I write a layout component called `WithLegend` - Given `renderLegend` and `renderChart` as render props, it will give space enough to render the legend and give the rest of the container to the chart (via flexbox). - `renderChart` is wrapped in `@vx/responsive/ParentSize` and will be given `parent`. Developer then can pass `parent.width` and `parent.height` to the chart. - Developer can also set the legend position (`top`, `left`, `bottom`, `right`), and it will put the legend there. - It will also pass the `flexDirection` to the legend component, which `@vx/legend` can directly use to arrange item left-to-right or top-to-bottom appropriately. For example, legend on the top should arrange legend items left-to-right, legend on the right should arrange legend items top-to-bottom p.s. The `shape="rect"` gives rect, but my screenshot above was outdated. Thanks for the custom shape tldr tho. Very useful.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
