Changed default legend position
This commit is contained in:
@@ -885,8 +885,7 @@ function Legend(p: { props: ChartProps; legend: ChartLegend | null; colorOf: (i:
|
||||
// row under the plot. An explicit ChartLegend picks the row/column axis (orientation)
|
||||
// and where along it the legend sits (position).
|
||||
const containerClass = () => {
|
||||
const cfg = p.legend;
|
||||
if (!cfg) return "mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5";
|
||||
const cfg = p.legend ?? {orientation: "horizontal", position: "bottom-center"};
|
||||
if (cfg.orientation === "vertical") {
|
||||
const justify = cfg.position.startsWith("top") ? "justify-start"
|
||||
: cfg.position.startsWith("bottom") ? "justify-end" : "justify-center";
|
||||
|
||||
Reference in New Issue
Block a user