Zoom for Diagrams in Trend View

134 views
Skip to first unread message

Stefan Rothbauer

unread,
Feb 23, 2018, 1:01:02 PM2/23/18
to golden-cheetah-users
Hi,


In the activity view for the diagrams under Activity I can zoom x and y axis, which is very helpful when I am interested in details.

In trends view that seems not possible. Also in some diagrams in activities view like the CP diagram I do not have sliders.

Is there any way to zoom into diagrams in trend view?
I would highly appreciate if that could be done.
For any hints on how to accomplish that I am very grateful.

Best regards,

Stefan

PS: I know this might be doable with the R or Python programming, but it seems to be something that most users would benefit if it was part of GC 




Mark Liversedge

unread,
Feb 23, 2018, 2:47:55 PM2/23/18
to golden-cheetah-users
Each type of chart has different controls.

Which chart are you trying to zoom?

Mark

Stefan Rothbauer

unread,
Feb 23, 2018, 5:18:31 PM2/23/18
to golden-cheetah-users
The current interest was to zoom into CP in the activities view to get a clearer picture for 2 h to 2:15 h

From a user point of view when analysing data graphically: zooming is a very common desire. If it could be applied to all (or almost all) diagrams with little effort that would be great...
I have no idea what that means on the development side however.

Stefan

Stefan Rothbauer

unread,
Feb 23, 2018, 5:26:19 PM2/23/18
to golden-cheetah-users
I would like to do this also in trends view for CP.

In Activities view I wanted to get a clearer picture on the dates, at which the maximum power values were produced.

I can do a very basic Python Chart for activityMeanmax and seasonMeanmax of power, and can zoom with plotly. 
What I could not figure out was how to show the dates for the seasonMeanmax Power curve on hover over with the mouse.
Also I could not easily apply a filter like "last three months" or Base_2018 for the seasonMeanmax.
Maybe there is an easy way to do that?

Still I might think, that many users would find zoomin in e. g. CP diagrams useful, so maybe it is worth to make it easily accessible if possible.

Below is the python code that I used.

Best,

Stefan


##

## Python program will run on selection.

##


import numpy as np

import plotly

from plotly.graph_objs import Scatter, Layout, Figure, Heatmap


mma = 0

mmS = 0


mmA = GC.activityMeanmax()

mmS = GC.seasonMeanmax()


yyA = np.asarray(mmA["power"])

yyA[0] = yyA[1]

xxA = [s/60 for s in range(1, len(yyA)+1)]


yyS = np.asarray(mmS["power"])

xxS = [s/60 for s in range(1, len(yyS)+1)]

yyS[0] = yyS[1]


plotOutFile = "D:/tmp/GC_activities_plot_temp.html"


traceA = Scatter(x=xxA, y=yyA, mode='lines')

traceS = Scatter(x=xxS, y=yyS, mode='lines')


data = [traceA, traceS]


layout = dict(title="CP Activity vs. CP Season", xaxis = dict(title="Duration (min)", type='log'), yaxis = dict(title="Power"))

fig = dict(data=data, layout=layout)

plotly.offline.plot(fig, filename=plotOutFile, auto_open = False)


print(max(yyA))

print(max(yyS))


GC.webpage(plotOutFile)


Ale Martinez

unread,
Feb 24, 2018, 10:59:32 AM2/24/18
to golden-cheetah-users
>Also I could not easily apply a filter like "last three months" or Base_2018 for the seasonMeanmax.
Maybe there is an easy way to do that?

seasonMeanmax uses the selected Date Range in Trends sidebar, unless all=True is requested

Stefan Rothbauer

unread,
Feb 24, 2018, 2:10:29 PM2/24/18
to golden-cheetah-users
Hi Ale,

How can I use a date range for seasonMeanmax in Activities view?
Or is there an easy way to filter in the python code?

Thanks for any hints!

Stefan

Ale Martinez

unread,
Feb 24, 2018, 7:14:10 PM2/24/18
to golden-cheetah-users
The behavior of the API is the same in Trends and Activities, if you want the last 3 months you can call seasonMeanmax with all=True and filter=‘Date>Today-90’

Stefan Rothbauer

unread,
Feb 25, 2018, 12:48:29 PM2/25/18
to golden-cheetah-users
Thanks!

Seem like just a like piece of information was missing to me.

I will trythis.

Best, Stefan

Reply all
Reply to author
Forward
0 new messages