File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
packages/test-app/src/test-app-app Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ class TestAppApp extends PolymerElement {
67
67
68
68
< div > SUPPLY [[supply]]</ div >
69
69
< div id ="chartbox ">
70
- < base-chart
70
+ < base-chart
71
+ responsive
71
72
id ="chart "
72
73
type ="line "
73
74
data ="{{chartData}} "
@@ -118,6 +119,11 @@ class TestAppApp extends PolymerElement {
118
119
_triggerHistory ( token ) {
119
120
var me = this ;
120
121
let url = `https://coincap.io/history/${ this . durations [ this . duration ] } /${ token . name } ` ;
122
+
123
+ function _createLabel ( token , dataset , duration ) {
124
+ return token . name + ' ' + dataset + ' ' + duration ;
125
+ }
126
+
121
127
fetch ( url )
122
128
. then ( function ( response ) {
123
129
return response . json ( ) ;
@@ -133,11 +139,14 @@ class TestAppApp extends PolymerElement {
133
139
var data = data . map ( ( row , index ) => {
134
140
return row [ 1 ] ;
135
141
} ) ;
136
-
142
+ let dataset = me . datasets [ me . dataset ] ;
143
+ let duration = me . durations [ me . duration ] ;
144
+ console . log
137
145
var data = {
138
146
labels : labels ,
139
147
datasets : [
140
- {
148
+ {
149
+ label : _createLabel ( token , dataset , duration ) ,
141
150
data : data
142
151
} ]
143
152
} ;
You can’t perform that action at this time.
0 commit comments