From ed6e4ff8fceea9414f234493246514b0ea7c2348 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 15 Dec 2020 13:53:34 +0100 Subject: [PATCH] fx --- rowers/interactiveplots.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 31aa8a26..4bc6cfd6 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -697,12 +697,16 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type',toolbar_lo bars=table.to.bars(['date',stack],[yaxis]) - bars.opts( - opts.Bars(cmap=mytypes.color_map, show_legend=True, stacked=True, - tools=['tap','hover'], width=550, xrotation=45,padding=(0,(0,.1)), - legend_position='bottom',show_frame=True)) - - + if stack == 'type': + bars.opts( + opts.Bars(cmap=mytypes.color_map, show_legend=True, stacked=True, + tools=['tap','hover'], width=550, xrotation=45,padding=(0,(0,.1)), + legend_position='bottom',show_frame=True)) + else: + bars.opts( + opts.Bars(cmap='Category10', show_legend=True, stacked=True, + tools=['tap','hover'], width=550, xrotation=45,padding=(0,(0,.1)), + legend_position='bottom',show_frame=True)) p = hv.render(bars) @@ -876,10 +880,12 @@ def interactive_activitychart2(workouts,startdate,enddate,stack='type',toolbar_l bars=table.to.bars(['date',stack],[yaxis]) + bars.opts( opts.Bars(cmap=mytypes.color_map, show_legend=True, stacked=True, - tools=['tap','hover'], width=550, xrotation=45,padding=(0,(0,.1)), - legend_position='bottom',show_frame=True)) + tools=['tap','hover'], width=550, xrotation=45,padding=(0,(0,.1)), + legend_position='bottom',show_frame=True)) +