From ff85546e3f5cd074ce5a046dcc5c6eb6171ed605 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 17 Jun 2017 09:14:12 +0100 Subject: [PATCH] block size chart formatting fixes --- src/Template/Main/blocks.ctp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Template/Main/blocks.ctp b/src/Template/Main/blocks.ctp index 96688df..c857d48 100644 --- a/src/Template/Main/blocks.ctp +++ b/src/Template/Main/blocks.ctp @@ -228,6 +228,13 @@ useLineColorForBulletBorder: true, lineColor: '#00e676', balloonText: '$[[AvgUSD]]', + balloonFunction: function(item, graph) { + var result = graph.balloonText; + if (!item.dataContext.AvgUSD) { + return ''; + } + return result.replace('[[AvgUSD]]', item.dataContext.AvgUSD.toFixed(2)); + }, hideBulletsCount: 30, labelFunction: function(value) { return '$' + value; @@ -256,7 +263,7 @@ return g.balloonText.replace('[[AvgBlockSize]]', Math.round((item.dataContext.AvgBlockSize / 1000) * 100)/100); } if (g.id === 'g-price' && item.dataContext.AvgUSD) { - return g.balloonText.replace('[[AvgUSD]]', item.dataContext.AvgUSD); + return g.balloonText.replace('[[AvgUSD]]', item.dataContext.AvgUSD.toFixed(2)); } } @@ -297,6 +304,7 @@ var isHourly = (dataPeriod.indexOf('h') > -1); chart.categoryAxis.minPeriod = isHourly ? 'hh' : 'DD'; chart.categoryAxis.dateFormats[4].format = isHourly ? 'DD MMM' : 'DD'; + chart.chartCursor.categoryBalloonDateFormat = isHourly ? 'D MMM HH:NN ' : 'D MMM YYYY'; chart.dataProvider = chartData; chart.validateNow(); chart.validateData();