pull/2538/head
Ayrat Badykov 5 years ago
parent c9966750b9
commit b944d936cf
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 12
      apps/block_scout_web/assets/js/lib/coin_balance_history_chart.js
  2. 1
      apps/explorer/lib/explorer/chain/address/coin_balance.ex

@ -18,13 +18,13 @@ export function createCoinBalanceHistoryChart (el) {
y: balance.value
}))
var step_size = 3
var stepSize = 3
if (data.length > 2) {
console.log(data[0].date)
var diff = Math.abs(new Date(data[0].date) - new Date(data[1].date));
var period_in_days = diff / (1000 * 60 * 60 * 24)
step_size = period_in_days
var diff = Math.abs(new Date(data[0].date) - new Date(data[1].date))
var periodInDays = diff / (1000 * 60 * 60 * 24)
console.log(periodInDays)
stepSize = periodInDays
}
return new Chart(el, {
type: 'line',
@ -44,7 +44,7 @@ export function createCoinBalanceHistoryChart (el) {
type: 'time',
time: {
unit: 'day',
stepSize: step_size
stepSize: stepSize
}
}],
yAxes: [{

@ -115,7 +115,6 @@ defmodule Explorer.Chain.Address.CoinBalance do
|> select([cb, b], %{timestamp: b.timestamp})
end
def changeset(%__MODULE__{} = balance, params) do
balance
|> cast(params, @allowed_fields)

Loading…
Cancel
Save