From 85c2904cf983f0752ee90d33da8e013c3d5155b0 Mon Sep 17 00:00:00 2001 From: rakow Date: Tue, 11 Jun 2024 20:51:44 +0200 Subject: [PATCH] fix pivot usage --- .../java/org/matsim/simwrapper/dashboard/TripDashboard.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contribs/simwrapper/src/main/java/org/matsim/simwrapper/dashboard/TripDashboard.java b/contribs/simwrapper/src/main/java/org/matsim/simwrapper/dashboard/TripDashboard.java index 1ab7dee2244..fb62854d9e5 100644 --- a/contribs/simwrapper/src/main/java/org/matsim/simwrapper/dashboard/TripDashboard.java +++ b/contribs/simwrapper/src/main/java/org/matsim/simwrapper/dashboard/TripDashboard.java @@ -369,14 +369,13 @@ private void createGroupedTab(Layout layout, String[] args) { viz.title = "Mode share"; viz.description = "by " + cat; viz.layout = tech.tablesaw.plotly.components.Layout.builder() - .xAxis(Axis.builder().title("dist_group").build()) - .yAxis(Axis.builder().title("sim_share").build()) + .xAxis(Axis.builder().title("share").build()) .barMode(tech.tablesaw.plotly.components.Layout.BarMode.STACK) .build(); // TODO: Still in testing Plotly.DataMapping ds = viz.addDataset(data.computeWithPlaceholder(TripAnalysis.class, "mode_share_per_%s.csv", cat)) - .pivot(List.of("main_mode"), "source", "share") + .pivot(List.of("main_mode", "dist_group", cat), "source", "share") .aggregate(List.of("main_mode", "source", cat), "share", Plotly.AggrFunc.SUM) .mapping() .facetCol(cat)