From 7ebf85eacf18585f94aad5a82e8a785e79084c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AC=B8=EC=8A=B9=EC=B0=AC?= Date: Wed, 8 Jun 2016 10:16:38 +0900 Subject: [PATCH 1/5] change tooltip font color option bodyColor -> bodyFontColor titleColor -> titleFontColor footerColor -> footerFontColor --- src/core/core.tooltip.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 src/core/core.tooltip.js diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js old mode 100644 new mode 100755 index 113c94f4124..2488569b40d --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -159,7 +159,7 @@ module.exports = function(Chart) { yAlign : tooltipOpts.xAlign, // Body - bodyColor: tooltipOpts.bodyColor, + bodyFontColor: tooltipOpts.bodyFontColor, _bodyFontFamily: getValueOrDefault(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily), _bodyFontStyle: getValueOrDefault(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle), _bodyAlign: tooltipOpts.bodyAlign, @@ -167,7 +167,7 @@ module.exports = function(Chart) { bodySpacing: tooltipOpts.bodySpacing, // Title - titleColor: tooltipOpts.titleColor, + titleFontColor: tooltipOpts.titleFontColor, _titleFontFamily: getValueOrDefault(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily), _titleFontStyle: getValueOrDefault(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle), titleFontSize: getValueOrDefault(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize), @@ -176,7 +176,7 @@ module.exports = function(Chart) { titleMarginBottom: tooltipOpts.titleMarginBottom, // Footer - footerColor: tooltipOpts.footerColor, + footerFontColor: tooltipOpts.footerFontColor, _footerFontFamily: getValueOrDefault(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily), _footerFontStyle: getValueOrDefault(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle), footerFontSize: getValueOrDefault(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize), @@ -611,7 +611,7 @@ module.exports = function(Chart) { var drawColorBoxes = body.length > 1; xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0; - + // Draw body lines now helpers.each(body, function(bodyItem, i) { helpers.each(bodyItem.before, fillLineOfText); @@ -636,7 +636,7 @@ module.exports = function(Chart) { fillLineOfText(line); }); - + helpers.each(bodyItem.after, fillLineOfText); }); From 5687aa479fe2f48ecea0d97d990464d3b98ee09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AC=B8=EC=8A=B9=EC=B0=AC?= Date: Wed, 8 Jun 2016 10:22:47 +0900 Subject: [PATCH 2/5] Fix tooltip core test case Change tooltip font color options this options changed in tooltip core bodyColor -> bodyFontColor titleColor -> titleFontColor footerColor -> footerFontColor --- test/core.tooltip.tests.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) mode change 100644 => 100755 test/core.tooltip.tests.js diff --git a/test/core.tooltip.tests.js b/test/core.tooltip.tests.js old mode 100644 new mode 100755 index bf48b6f489f..39039fd655b --- a/test/core.tooltip.tests.js +++ b/test/core.tooltip.tests.js @@ -33,7 +33,7 @@ describe('tooltip tests', function() { } }); - // Trigger an event over top of the + // Trigger an event over top of the var meta = chartInstance.getDatasetMeta(0); var point = meta.data[1]; @@ -63,7 +63,7 @@ describe('tooltip tests', function() { yAlign: 'center', // Body - bodyColor: '#fff', + bodyFontColor: '#fff', _bodyFontFamily: globalDefaults.defaultFontFamily, _bodyFontStyle: globalDefaults.defaultFontStyle, _bodyAlign: 'left', @@ -80,7 +80,7 @@ describe('tooltip tests', function() { titleMarginBottom: 6, // Footer - footerColor: '#fff', + footerFontColor: '#fff', _footerFontFamily: globalDefaults.defaultFontFamily, _footerFontStyle: 'bold', footerFontSize: globalDefaults.defaultFontSize, @@ -147,7 +147,7 @@ describe('tooltip tests', function() { } }); - // Trigger an event over top of the + // Trigger an event over top of the var meta = chartInstance.getDatasetMeta(0); var point = meta.data[1]; @@ -177,7 +177,7 @@ describe('tooltip tests', function() { yAlign: 'center', // Body - bodyColor: '#fff', + bodyFontColor: '#fff', _bodyFontFamily: globalDefaults.defaultFontFamily, _bodyFontStyle: globalDefaults.defaultFontStyle, _bodyAlign: 'left', @@ -194,7 +194,7 @@ describe('tooltip tests', function() { titleMarginBottom: 6, // Footer - footerColor: '#fff', + footerFontColor: '#fff', _footerFontFamily: globalDefaults.defaultFontFamily, _footerFontStyle: 'bold', footerFontSize: globalDefaults.defaultFontSize, @@ -286,7 +286,7 @@ describe('tooltip tests', function() { } }); - // Trigger an event over top of the + // Trigger an event over top of the var meta = chartInstance.getDatasetMeta(0); var point = meta.data[1]; @@ -316,7 +316,7 @@ describe('tooltip tests', function() { yAlign: 'top', // Body - bodyColor: '#fff', + bodyFontColor: '#fff', _bodyFontFamily: globalDefaults.defaultFontFamily, _bodyFontStyle: globalDefaults.defaultFontStyle, _bodyAlign: 'left', @@ -324,7 +324,7 @@ describe('tooltip tests', function() { bodySpacing: 2, // Title - titleColor: '#fff', + titleFontColor: '#fff', _titleFontFamily: globalDefaults.defaultFontFamily, _titleFontStyle: 'bold', titleFontSize: globalDefaults.defaultFontSize, @@ -333,7 +333,7 @@ describe('tooltip tests', function() { titleMarginBottom: 6, // Footer - footerColor: '#fff', + footerFontColor: '#fff', _footerFontFamily: globalDefaults.defaultFontFamily, _footerFontStyle: 'bold', footerFontSize: globalDefaults.defaultFontSize, @@ -403,7 +403,7 @@ describe('tooltip tests', function() { } }); - // Trigger an event over top of the + // Trigger an event over top of the var meta0 = chartInstance.getDatasetMeta(0); var point0 = meta0.data[1]; @@ -426,7 +426,7 @@ describe('tooltip tests', function() { // Check and see if tooltip was displayed var tooltip = chartInstance.tooltip; - + expect(tooltip._view).toEqual(jasmine.objectContaining({ // Positioning xAlign: 'left', From d6e5b5e79a38d55d96f41b22225558851d11a0d3 Mon Sep 17 00:00:00 2001 From: Jack Valentine Date: Wed, 8 Jun 2016 23:01:41 +0900 Subject: [PATCH 3/5] core tooltip test case fixe titleColor options is not available titleColor change to titleFontColor --- test/core.tooltip.tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core.tooltip.tests.js b/test/core.tooltip.tests.js index 39039fd655b..6840d146344 100755 --- a/test/core.tooltip.tests.js +++ b/test/core.tooltip.tests.js @@ -71,7 +71,7 @@ describe('tooltip tests', function() { bodySpacing: 2, // Title - titleColor: '#fff', + titleFontColor: '#fff', _titleFontFamily: globalDefaults.defaultFontFamily, _titleFontStyle: 'bold', titleFontSize: globalDefaults.defaultFontSize, From 99d3f423cb596ca7d2a36981244e1912b0c47b44 Mon Sep 17 00:00:00 2001 From: Jack Valentine Date: Wed, 8 Jun 2016 23:15:21 +0900 Subject: [PATCH 4/5] titleColor options is not available titleColor change to titleFontColor --- test/core.tooltip.tests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/core.tooltip.tests.js b/test/core.tooltip.tests.js index 6840d146344..c2497b8c3f1 100755 --- a/test/core.tooltip.tests.js +++ b/test/core.tooltip.tests.js @@ -185,7 +185,7 @@ describe('tooltip tests', function() { bodySpacing: 2, // Title - titleColor: '#fff', + titleFontColor: '#fff', _titleFontFamily: globalDefaults.defaultFontFamily, _titleFontStyle: 'bold', titleFontSize: globalDefaults.defaultFontSize, From 29bc3b0b8bfef02da608abcf22021bb82b04afad Mon Sep 17 00:00:00 2001 From: Jack Valentine Date: Thu, 9 Jun 2016 00:04:20 +0900 Subject: [PATCH 5/5] ChartJS tooltip fontColor fix fixed global variable name fix callback variable name fix - 'titleColor' to 'titleFontColor' - 'bodyColor' to 'bodyFontColor' - 'footerColor' to 'footerFontColor' --- src/core/core.tooltip.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index 2488569b40d..e2193414051 100755 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -12,15 +12,15 @@ module.exports = function(Chart) { titleFontStyle: "bold", titleSpacing: 2, titleMarginBottom: 6, - titleColor: "#fff", + titleFontColor: "#fff", titleAlign: "left", bodySpacing: 2, - bodyColor: "#fff", + bodyFontColor: "#fff", bodyAlign: "left", footerFontStyle: "bold", footerSpacing: 2, footerMarginTop: 6, - footerColor: "#fff", + footerFontColor: "#fff", footerAlign: "left", yPadding: 6, xPadding: 6, @@ -571,8 +571,8 @@ module.exports = function(Chart) { var titleFontSize = vm.titleFontSize, titleSpacing = vm.titleSpacing; - var titleColor = helpers.color(vm.titleColor); - ctx.fillStyle = titleColor.alpha(opacity * titleColor.alpha()).rgbString(); + var titleFontColor = helpers.color(vm.titleFontColor); + ctx.fillStyle = titleFontColor.alpha(opacity * titleFontColor.alpha()).rgbString(); ctx.font = helpers.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily); var i, len; @@ -594,8 +594,8 @@ module.exports = function(Chart) { ctx.textAlign = vm._bodyAlign; ctx.textBaseline = "top"; - var bodyColor = helpers.color(vm.bodyColor); - var textColor = bodyColor.alpha(opacity * bodyColor.alpha()).rgbString(); + var bodyFontColor = helpers.color(vm.bodyFontColor); + var textColor = bodyFontColor.alpha(opacity * bodyFontColor.alpha()).rgbString(); ctx.fillStyle = textColor; ctx.font = helpers.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily); @@ -656,8 +656,8 @@ module.exports = function(Chart) { ctx.textAlign = vm._footerAlign; ctx.textBaseline = "top"; - var footerColor = helpers.color(vm.footerColor); - ctx.fillStyle = footerColor.alpha(opacity * footerColor.alpha()).rgbString(); + var footerFontColor = helpers.color(vm.footerFontColor); + ctx.fillStyle = footerFontColor.alpha(opacity * footerFontColor.alpha()).rgbString(); ctx.font = helpers.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily); helpers.each(footer, function(line) {