@@ -39,10 +39,6 @@ Item {
39
39
onNetworkFiltersChanged: d .forceRefreshBalanceStore = true
40
40
/* required*/ property string address: " "
41
41
42
- TokenBalanceHistoryData {
43
- id: balanceData
44
- }
45
-
46
42
TokenMarketValuesData {
47
43
id: marketValueData
48
44
}
@@ -126,8 +122,7 @@ Item {
126
122
}
127
123
128
124
enum GraphType {
129
- Price = 0 ,
130
- Balance
125
+ Price = 0
131
126
}
132
127
133
128
StatusScrollView {
@@ -180,7 +175,6 @@ Item {
180
175
181
176
graphsModel: [
182
177
{text: qsTr (" Price" ), enabled: true , id: AssetsDetailView .GraphType .Price , visible: ! d .isCommunityAsset },
183
- {text: qsTr (" Balance" ), enabled: true , id: AssetsDetailView .GraphType .Balance , visible: true },
184
178
]
185
179
defaultTimeRangeIndexShown: ChartDataBase .TimeRange .All
186
180
timeRangeModel: dataReady () && selectedStore .timeRangeTabsModel
@@ -189,23 +183,13 @@ Item {
189
183
graphDetail .selectedGraphType = privateIdentifier
190
184
}
191
185
192
- if (graphDetail .selectedGraphType === AssetsDetailView .GraphType .Balance ) {
193
- graphDetail .updateBalanceStore ()
194
- }
195
-
196
186
if (! isTimeRange) {
197
- graphDetail .selectedStore = graphDetail . selectedGraphType === AssetsDetailView . GraphType . Price ? marketValueData : balanceData
187
+ graphDetail .selectedStore = marketValueData
198
188
}
199
189
200
190
chart .refresh ()
201
191
}
202
192
203
- readonly property var dateToShortLabel : function (value ) {
204
- const range = balanceData .timeRangeStrToEnum (graphDetail .selectedTimeRange )
205
- return range === ChartDataBase .TimeRange .Weekly || range === ChartDataBase .TimeRange .Monthly ?
206
- LocaleUtils .getDayMonth (value) :
207
- LocaleUtils .getMonthYear (value)
208
- }
209
193
chart .type : ' line'
210
194
chart .labels : root .tokensStore .marketHistoryIsLoading ? [] : graphDetail .labelsData
211
195
chart .datasets : {
@@ -242,15 +226,6 @@ Item {
242
226
// },
243
227
// pan:{enabled:true,mode:'x'},
244
228
tooltips: {
245
- format: {
246
- enabled: graphDetail .selectedGraphType === AssetsDetailView .GraphType .Balance ,
247
- callback : function (value ) {
248
- return graphDetail .dateToShortLabel (value)
249
- },
250
- valueCallback : function (value ) {
251
- return root .currencyStore .formatCurrencyAmount (value, root .currencyStore .currentCurrency )
252
- }
253
- },
254
229
intersect: false ,
255
230
displayColors: false ,
256
231
callbacks: {
@@ -260,9 +235,6 @@ Item {
260
235
label += ' : ' ;
261
236
}
262
237
263
- if (graphDetail .selectedGraphType === AssetsDetailView .GraphType .Balance )
264
- return label + tooltipItem .yLabel // already formatted in tooltips.value.callback
265
-
266
238
const value = root .currencyStore .formatCurrencyAmount (
267
239
tooltipItem .yLabel , root .currencyStore .currentCurrency )
268
240
@@ -271,12 +243,6 @@ Item {
271
243
}
272
244
},
273
245
scales: {
274
- labelFormat: {
275
- callback : function (value ) {
276
- return graphDetail .dateToShortLabel (value)
277
- },
278
- enabled: graphDetail .selectedGraphType === AssetsDetailView .GraphType .Balance ,
279
- },
280
246
xAxes: [{
281
247
id: ' x-axis-1' ,
282
248
position: ' bottom' ,
@@ -333,35 +299,6 @@ Item {
333
299
active: root .tokensStore .marketHistoryIsLoading
334
300
}
335
301
336
- function updateBalanceStore () {
337
- let selectedTimeRangeEnum = balanceData .timeRangeStrToEnum (graphDetail .selectedTimeRange )
338
-
339
- let currencySymbol = root .currencyStore .currentCurrency
340
-
341
- if (! balanceData .hasData (root .address , token .symbol , currencySymbol, selectedTimeRangeEnum) || d .forceRefreshBalanceStore ) {
342
- root .tokensStore .fetchHistoricalBalanceForTokenAsJson (root .address , token .symbol , currencySymbol, selectedTimeRangeEnum)
343
- }
344
- }
345
-
346
- Connections {
347
- target: balanceData
348
- function onNewDataReady (address , tokenSymbol , currencySymbol , timeRange ) {
349
- d .forceRefreshBalanceStore = false
350
- if (timeRange === balanceData .timeRangeStrToEnum (graphDetail .selectedTimeRange )) {
351
- chart .refresh ()
352
- }
353
- }
354
- }
355
-
356
- Connections {
357
- target: root
358
- function onAddressChanged () { graphDetail .updateBalanceStore () }
359
- }
360
-
361
- Connections {
362
- target: d
363
- function onSymbolChanged () { if (d .symbol ) graphDetail .updateBalanceStore () }
364
- }
365
302
}
366
303
}
367
304
0 commit comments