improved hrv gc native plot
This commit is contained in:
parent
9de3a50780
commit
50e60e38a9
1 changed files with 25 additions and 8 deletions
|
|
@ -163,15 +163,23 @@ def plot_plotly():
|
|||
|
||||
|
||||
def plot_native():
|
||||
GC.setChart(title='test',
|
||||
type=GC.CHART_LINE,
|
||||
GC.setChart(type=GC.CHART_LINE,
|
||||
orientation=GC_VERTICAL,
|
||||
legpos=GC_ALIGN_TOP,
|
||||
legpos=GC_ALIGN_RIGHT,
|
||||
stack=False,
|
||||
animate=False)
|
||||
animate=True)
|
||||
hrv_data['date_internal'] = (hrv_data['date'] -
|
||||
pd.to_datetime('1900-01-01').date()).dt.days
|
||||
xx = hrv_data['date_internal']
|
||||
settings = dict(symbol=GC_SYMBOL_CIRCLE,
|
||||
line=GC_LINE_NONE,
|
||||
color='gray',
|
||||
opacity=20,
|
||||
xaxis='Date',
|
||||
yaxis='lnRMSSD',
|
||||
size=3,
|
||||
opengl=False)
|
||||
GC.addCurve(name='Measurement', x=xx, y=hrv_data[HRV], **settings)
|
||||
settings = dict(symbol=GC_SYMBOL_NONE,
|
||||
line=GC_LINE_SOLID,
|
||||
color='red',
|
||||
|
|
@ -180,25 +188,34 @@ def plot_native():
|
|||
yaxis='lnRMSSD',
|
||||
size=3,
|
||||
opengl=False)
|
||||
GC.addCurve(name='HRV', x=xx, y=hrv_data[HRV_BASE], **settings)
|
||||
|
||||
settings['color'] = 'green'
|
||||
settings['opacity'] = 50
|
||||
settings['opacity'] = 100
|
||||
settings['line'] = GC_LINE_DASH
|
||||
GC.addCurve(name='Normal Top', x=xx, y=hrv_data[HRV_CEILING], **settings)
|
||||
GC.addCurve(name='Normal Bot', x=xx, y=hrv_data[HRV_FLOOR], **settings)
|
||||
|
||||
settings['color'] = 'red'
|
||||
settings['line'] = GC_LINE_SOLID
|
||||
GC.addCurve(name='HRV', x=xx, y=hrv_data[HRV_BASE], **settings)
|
||||
|
||||
settings['color'] = 'yellow'
|
||||
settings['opacity'] = 100
|
||||
settings['line'] = GC_LINE_SOLID
|
||||
settings['yaxis'] = 'Coefficient of Variation'
|
||||
settings['xaxis'] = 'Date2'
|
||||
GC.addCurve(name='Variation', x=xx, y=hrv_data[HRV_CV], **settings)
|
||||
|
||||
GC.setAxis('Date', type=GC.AXIS_DATE)
|
||||
GC.setAxis('Date2', type=GC.AXIS_DATE)
|
||||
GC.setAxis('Coefficient of Variation',
|
||||
type=GC.AXIS_CONTINUOUS,
|
||||
min=0,
|
||||
max=50)
|
||||
max=25)
|
||||
GC.setAxis('lnRMSSD',
|
||||
type=GC.AXIS_CONTINUOUS,
|
||||
min=4.0,
|
||||
max=10.0,
|
||||
color='red')
|
||||
|
||||
|
||||
def get_hrv_measures():
|
||||
|
|
|
|||
Loading…
Reference in a new issue