Fixed legend

pull/2404/head
slightlycyborg 5 years ago
parent 651a714116
commit 1ca21a2992
  1. 1
      apps/block_scout_web/assets/css/components/_dashboard-banner.scss
  2. 14
      apps/block_scout_web/assets/js/lib/history_chart.js

@ -69,6 +69,7 @@ $dashboard-banner-chart-axis-font-color: $dashboard-stats-item-value-color !defa
display: grid; display: grid;
grid-template-columns: repeat(var(--numChartData), 0.9fr); grid-template-columns: repeat(var(--numChartData), 0.9fr);
padding-bottom: 12px; padding-bottom: 12px;
padding-left:15px;
.dashboard-banner-chart-legend-item { .dashboard-banner-chart-legend-item {
padding-bottom: 3px; padding-bottom: 3px;

@ -44,7 +44,6 @@ const config = {
} }
}, { }, {
id: 'marketCap', id: 'marketCap',
display: false,
gridLines: { gridLines: {
display: false, display: false,
drawBorder: false drawBorder: false
@ -56,8 +55,7 @@ const config = {
} }
}, { }, {
id: 'numTransactions', id: 'numTransactions',
display: false, position: "right",
position: 'right',
gridLines: { gridLines: {
display: false, display: false,
drawBorder: false drawBorder: false
@ -111,6 +109,9 @@ class MarketHistoryChart {
}, },
{}) {})
var priceActivated = true
var marketCapActivated = true
this.price = { this.price = {
label: window.localized['Price'], label: window.localized['Price'],
yAxisID: 'price', yAxisID: 'price',
@ -124,6 +125,7 @@ class MarketHistoryChart {
if (dataConfig.market === undefined || dataConfig.market.indexOf('price') === -1) { if (dataConfig.market === undefined || dataConfig.market.indexOf('price') === -1) {
this.price.hidden = true this.price.hidden = true
axes['price'].display = false axes['price'].display = false
priceActivated = false
} }
this.marketCap = { this.marketCap = {
@ -139,6 +141,7 @@ class MarketHistoryChart {
if (dataConfig.market === undefined || dataConfig.market.indexOf('market_cap') === -1) { if (dataConfig.market === undefined || dataConfig.market.indexOf('market_cap') === -1) {
this.marketCap.hidden = true this.marketCap.hidden = true
axes['marketCap'].display = false axes['marketCap'].display = false
marketCapActivated = false
} }
this.numTransactions = { this.numTransactions = {
@ -151,9 +154,14 @@ class MarketHistoryChart {
borderColor: sassVariables.dashboardLineColorTransactions, borderColor: sassVariables.dashboardLineColorTransactions,
lineTension: 0 lineTension: 0
} }
if (dataConfig.transactions === undefined || dataConfig.transactions.indexOf('transactions_per_day') === -1) { if (dataConfig.transactions === undefined || dataConfig.transactions.indexOf('transactions_per_day') === -1) {
this.numTransactions.hidden = true this.numTransactions.hidden = true
axes['numTransactions'].display = false axes['numTransactions'].display = false
} else if (!priceActivated && !marketCapActivated) {
axes['numTransactions'].position = 'left'
this.numTransactions.backgroundColor = sassVariables.dashboardLineColorPrice
this.numTransactions.borderColor = sassVariables.dashboardLineColorPrice
} }
this.availableSupply = availableSupply this.availableSupply = availableSupply

Loading…
Cancel
Save