mirror of
https://github.com/mempool/mempool.git
synced 2024-11-20 10:21:52 +01:00
Show "No data to display yet" until we have at least two points for node stats charts
This commit is contained in:
parent
77835bcb9d
commit
f1f6c48128
@ -75,7 +75,7 @@ export class NodeStatisticsChartComponent implements OnInit {
|
||||
|
||||
prepareChartOptions(data) {
|
||||
let title: object;
|
||||
if (data.channels.length === 0) {
|
||||
if (data.channels.length < 2) {
|
||||
title = {
|
||||
textStyle: {
|
||||
color: 'grey',
|
||||
@ -135,14 +135,14 @@ export class NodeStatisticsChartComponent implements OnInit {
|
||||
return tooltip;
|
||||
}
|
||||
},
|
||||
xAxis: data.channels.length === 0 ? undefined : {
|
||||
xAxis: data.channels.length < 2 ? undefined : {
|
||||
type: 'time',
|
||||
splitNumber: this.isMobile() ? 5 : 10,
|
||||
axisLabel: {
|
||||
hideOverlap: true,
|
||||
}
|
||||
},
|
||||
legend: data.channels.length === 0 ? undefined : {
|
||||
legend: data.channels.length < 2 ? undefined : {
|
||||
padding: 10,
|
||||
data: [
|
||||
{
|
||||
@ -167,7 +167,7 @@ export class NodeStatisticsChartComponent implements OnInit {
|
||||
'Capacity': true,
|
||||
}
|
||||
},
|
||||
yAxis: data.channels.length === 0 ? undefined : [
|
||||
yAxis: data.channels.length < 2 ? undefined : [
|
||||
{
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
@ -198,7 +198,7 @@ export class NodeStatisticsChartComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
],
|
||||
series: data.channels.length === 0 ? [] : [
|
||||
series: data.channels.length < 2 ? [] : [
|
||||
{
|
||||
zlevel: 1,
|
||||
name: $localize`:@@807cf11e6ac1cde912496f764c176bdfdd6b7e19:Channels`,
|
||||
|
Loading…
Reference in New Issue
Block a user