forked from npq7721/rpc-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added hashrate chart
- Loading branch information
Showing
16 changed files
with
381 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Tx Stats" : "Tx Stats", | ||
"Hashrates Chart" : "Hashrates Chart", | ||
"Hash Rate" : "Hash Rate Last 100 Blocks", | ||
"Hashes" : "Hashes", | ||
"Block" : "Block" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Tx Stats": "Tx Stats", | ||
"Hashrates Chart": "Hashrates Chart", | ||
"Hash Rate": "Hash Rate", | ||
"Block": "Block", | ||
"Hashes": "Hashes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
function chartLineGraph(id, graphTitle, xTitle, yTitle, dataUrl) { | ||
$.ajax({url: dataUrl, success: function(dataJson) { | ||
if((typeof dataJson) === "string") { | ||
dataJson = JSON.parse(dataJson); | ||
} | ||
var labels = Object.keys(dataJson); | ||
var values = Object.values(dataJson); | ||
var ctx = $(`#${id}`)[0].getContext('2d');; | ||
var chart = new Chart(ctx, { | ||
type: 'line', | ||
data: { | ||
labels: labels, | ||
datasets: [{ | ||
borderColor: '#36a2eb', | ||
borderWidth: 1, | ||
backgroundColor: '#84CBFA', | ||
data: values | ||
},] | ||
}, | ||
//HERE COMES THE AXIS Y LABEL | ||
options : { | ||
responsive: true, | ||
title: { | ||
display: true, | ||
text: graphTitle | ||
}, | ||
legend: { | ||
display: false | ||
}, | ||
tooltips: { | ||
mode: 'index', | ||
intersect: false, | ||
}, | ||
hover: { | ||
mode: 'nearest', | ||
intersect: true | ||
}, | ||
scales: { | ||
yAxes: [{ | ||
scaleLabel: { | ||
display: true, | ||
labelString: yTitle | ||
} | ||
}], | ||
xAxes: [{ | ||
scaleLabel: { | ||
display: true, | ||
labelString: xTitle | ||
} | ||
}] | ||
} | ||
} | ||
}); | ||
/*var graph = new Chart(ctx, { | ||
type: 'line', | ||
data: { | ||
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'], | ||
datasets: [{ | ||
borderColor: '#36a2eb', | ||
borderWidth: 1, | ||
backgroundColor: '#84CBFA', | ||
data: [1,2,4,5,6,7,8] | ||
}] | ||
}, | ||
options: { | ||
responsive: true, | ||
animation:{ | ||
duration:0 | ||
}, | ||
title: { | ||
display: true, | ||
text: graphTitle | ||
}, | ||
legend: { | ||
display: false | ||
}, | ||
tooltips: { | ||
mode: 'index', | ||
intersect: false, | ||
}, | ||
hover: { | ||
mode: 'nearest', | ||
intersect: true | ||
}, | ||
scales: { | ||
xAxes: [{ | ||
type: 'linear', | ||
position: 'bottom', | ||
scaleLabel: { | ||
display: true, | ||
labelString: xTitle | ||
} | ||
}], | ||
yAxes: [{ | ||
scaleLabel: { | ||
display: true, | ||
labelString: yTitle | ||
} | ||
}] | ||
} | ||
} | ||
});**/ | ||
} | ||
}); | ||
} |
Oops, something went wrong.