Rutgers University
Goldman Sachs
Zelco Solutions
avdaredevil@gmail.com
Demo Page for Issues
app.Data = {
BP: [[1442573315000,88],[1442917213000,90],[1443261111000,83.6]],
Rand: [[1442573315000,100],[1443573315000,22],[1443917213000,28],[1444261111000,50]]
}
app.$.BloodPressure.setData(app.Data.BP)
app.$.BloodPressure.addSeries("Random Other thing",app.Data.Rand)
var av = app.Data.BP.map(i => i[1]).reduce((p,c) => p+c,0)/app.Data.BP.length
app.$.BloodPressure.addSeries("Average BP",[[app.Data.BP[0][0],av],[app.Data.BP.slice(-1)[0][0],av]])
NOTE: The i => i[1] is actually i => i[1]
NOTE: Last 2 lines dynamically calculate average of BP and plot it
PS: You could also initialize the chart with the first series in the data="[series_1 array]", and manually initialize the rest
WARNING: DO NOT COPY THIS Code, just type it yourself, as the syntax highlighter runs the code inside for some reason, so I subbed a few characters with frech alternatives