further fixes with offsetting

This commit is contained in:
stoffu
2019-09-10 18:43:07 +09:00
parent fb8ea79ce9
commit ba0739c87c
29 changed files with 79 additions and 52 deletions
+4 -3
View File
@@ -1,9 +1,10 @@
function get_chart(chartData, cryptonote_config) {
chartData.shift();
function get_chart(chartData, cryptonote_config, offset) {
if (offset === undefined)
chartData.shift();
for (var i = 0; i < chartData.length; ++i) {
chartData[i].date = new Date(1000 * chartData[i][0]);
chartData[i].height = i + 1;
chartData[i].height = i + (offset === undefined ? 1 : offset.height);
chartData[i].difficulty = chartData[i][2];
chartData[i].hashrate = formatHashrate(chartData[i].difficulty / cryptonote_config.get_difficulty_target(chartData[i].height), 2);
}