diff --git a/src/core/core.js b/src/core/core.js index 31460f4fe..8c4bda98e 100755 --- a/src/core/core.js +++ b/src/core/core.js @@ -87,6 +87,10 @@ }, onClick: null, defaultColor: 'rgba(0,0,0,0.1)', + defaultFontColor: '#666', + defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", + defaultFontSize: 12, + defaultFontStyle: 'normal', // Element defaults defined in element extensions elements: {}, diff --git a/src/core/core.legend.js b/src/core/core.legend.js index 860249487..a91cf4376 100644 --- a/src/core/core.legend.js +++ b/src/core/core.legend.js @@ -22,10 +22,10 @@ labels: { boxWidth: 40, - fontSize: 12, - fontStyle: "normal", - fontColor: "#666", - fontFamily: "Helvetica Neue", + fontSize: Chart.defaults.global.defaultFontSize, + fontStyle: Chart.defaults.global.defaultFontStyle, + fontColor: Chart.defaults.global.defaultFontColor, + fontFamily: Chart.defaults.global.defaultFontFamily, padding: 10, // Generates labels shown in the legend // Valid properties to return: diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 721ea1f3a..b364bad13 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -22,10 +22,10 @@ // scale label scaleLabel: { - fontColor: '#666', - fontFamily: 'Helvetica Neue', - fontSize: 12, - fontStyle: 'normal', + fontColor: Chart.defaults.global.defaultFontColor, + fontFamily: Chart.defaults.global.defaultFontFamily, + fontSize: Chart.defaults.global.defaultFontSize, + fontStyle: Chart.defaults.global.defaultFontStyle, // actual label labelString: '', @@ -37,10 +37,10 @@ // label settings ticks: { beginAtZero: false, - fontSize: 12, - fontStyle: "normal", - fontColor: "#666", - fontFamily: "Helvetica Neue", + fontSize: Chart.defaults.global.defaultFontSize, + fontStyle: Chart.defaults.global.defaultFontStyle, + fontColor: Chart.defaults.global.defaultFontColor, + fontFamily: Chart.defaults.global.defaultFontFamily, maxRotation: 90, mirror: false, padding: 10, diff --git a/src/core/core.title.js b/src/core/core.title.js index 42ed8b54f..03a4903ac 100644 --- a/src/core/core.title.js +++ b/src/core/core.title.js @@ -10,9 +10,9 @@ position: 'top', fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes) - fontColor: '#666', - fontFamily: 'Helvetica Neue', - fontSize: 12, + fontColor: Chart.defaults.global.defaultFontColor, + fontFamily: Chart.defaults.global.defaultFontFamily, + fontSize: Chart.defaults.global.defaultFontSize, fontStyle: 'bold', padding: 10, diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index 37a43e5d3..ad3e17b73 100644 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -11,21 +11,21 @@ custom: null, mode: 'single', backgroundColor: "rgba(0,0,0,0.8)", - titleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - titleFontSize: 12, + titleFontFamily: Chart.defaults.global.defaultFontFamily, + titleFontSize: Chart.defaults.global.defaultFontSize, titleFontStyle: "bold", titleSpacing: 2, titleMarginBottom: 6, titleColor: "#fff", titleAlign: "left", - bodyFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - bodyFontSize: 12, - bodyFontStyle: "normal", + bodyFontFamily: Chart.defaults.global.defaultFontFamily, + bodyFontSize: Chart.defaults.global.defaultFontSize, + bodyFontStyle: Chart.defaults.global.defaultFontStyle, bodySpacing: 2, bodyColor: "#fff", bodyAlign: "left", - footerFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - footerFontSize: 12, + footerFontFamily: Chart.defaults.global.defaultFontFamily, + footerFontSize: Chart.defaults.global.defaultFontSize, footerFontStyle: "bold", footerSpacing: 2, footerMarginTop: 6, diff --git a/src/scales/scale.radialLinear.js b/src/scales/scale.radialLinear.js index beda63dae..1bfa64c61 100644 --- a/src/scales/scale.radialLinear.js +++ b/src/scales/scale.radialLinear.js @@ -36,16 +36,16 @@ pointLabels: { //String - Point label font declaration - fontFamily: "'Arial'", + fontFamily: Chart.defaults.global.defaultFontFamily, //String - Point label font weight - fontStyle: "normal", + fontStyle: Chart.defaults.global.defaultFontStyle, //Number - Point label font size in pixels fontSize: 10, //String - Point label font colour - fontColor: "#666", + fontColor: Chart.defaults.global.defaultFontColor, //Function - Used to convert point labels callback: function(label) { diff --git a/test/core.helpers.tests.js b/test/core.helpers.tests.js index 0e18c7a5c..224cc83f2 100644 --- a/test/core.helpers.tests.js +++ b/test/core.helpers.tests.js @@ -226,7 +226,7 @@ describe('Core helper tests', function() { position: "right", scaleLabel: { fontColor: '#666', - fontFamily: 'Helvetica Neue', + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: 'normal', labelString: '', @@ -235,7 +235,7 @@ describe('Core helper tests', function() { ticks: { beginAtZero: false, fontColor: "#666", - fontFamily: "Helvetica Neue", + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: "normal", maxRotation: 90, @@ -264,7 +264,7 @@ describe('Core helper tests', function() { position: "left", scaleLabel: { fontColor: '#666', - fontFamily: 'Helvetica Neue', + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: 'normal', labelString: '', @@ -273,7 +273,7 @@ describe('Core helper tests', function() { ticks: { beginAtZero: false, fontColor: "#666", - fontFamily: "Helvetica Neue", + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: "normal", maxRotation: 90, diff --git a/test/scale.category.tests.js b/test/scale.category.tests.js index 935ed604e..6389853ad 100644 --- a/test/scale.category.tests.js +++ b/test/scale.category.tests.js @@ -25,7 +25,7 @@ describe('Category scale tests', function() { position: "bottom", scaleLabel: { fontColor: '#666', - fontFamily: 'Helvetica Neue', + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: 'normal', labelString: '', @@ -34,7 +34,7 @@ describe('Category scale tests', function() { ticks: { beginAtZero: false, fontColor: "#666", - fontFamily: "Helvetica Neue", + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: "normal", maxRotation: 90, diff --git a/test/scale.linear.tests.js b/test/scale.linear.tests.js index a8b9738f9..a838da7e5 100644 --- a/test/scale.linear.tests.js +++ b/test/scale.linear.tests.js @@ -24,7 +24,7 @@ describe('Linear Scale', function() { position: "left", scaleLabel: { fontColor: '#666', - fontFamily: 'Helvetica Neue', + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: 'normal', labelString: '', @@ -33,7 +33,7 @@ describe('Linear Scale', function() { ticks: { beginAtZero: false, fontColor: "#666", - fontFamily: "Helvetica Neue", + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: "normal", maxRotation: 90, diff --git a/test/scale.logarithmic.tests.js b/test/scale.logarithmic.tests.js index b3bda00c7..8f5df2656 100644 --- a/test/scale.logarithmic.tests.js +++ b/test/scale.logarithmic.tests.js @@ -23,7 +23,7 @@ describe('Logarithmic Scale tests', function() { position: "left", scaleLabel: { fontColor: '#666', - fontFamily: 'Helvetica Neue', + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: 'normal', labelString: '', @@ -32,7 +32,7 @@ describe('Logarithmic Scale tests', function() { ticks: { beginAtZero: false, fontColor: "#666", - fontFamily: "Helvetica Neue", + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: "normal", maxRotation: 90, diff --git a/test/scale.radialLinear.tests.js b/test/scale.radialLinear.tests.js index e9ae118b2..784dde032 100644 --- a/test/scale.radialLinear.tests.js +++ b/test/scale.radialLinear.tests.js @@ -29,7 +29,7 @@ describe('Test the radial linear scale', function() { lineArc: false, pointLabels: { fontColor: "#666", - fontFamily: "'Arial'", + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 10, fontStyle: "normal", callback: defaultConfig.pointLabels.callback, // make this nicer, then check explicitly below @@ -37,7 +37,7 @@ describe('Test the radial linear scale', function() { position: "chartArea", scaleLabel: { fontColor: '#666', - fontFamily: 'Helvetica Neue', + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: 'normal', labelString: '', @@ -49,7 +49,7 @@ describe('Test the radial linear scale', function() { backdropPaddingX: 2, beginAtZero: false, fontColor: "#666", - fontFamily: "Helvetica Neue", + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: "normal", maxRotation: 90, diff --git a/test/scale.time.tests.js b/test/scale.time.tests.js index 87155deea..777e63ce9 100644 --- a/test/scale.time.tests.js +++ b/test/scale.time.tests.js @@ -28,7 +28,7 @@ describe('Time scale tests', function() { position: "bottom", scaleLabel: { fontColor: '#666', - fontFamily: 'Helvetica Neue', + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: 'normal', labelString: '', @@ -37,7 +37,7 @@ describe('Time scale tests', function() { ticks: { beginAtZero: false, fontColor: "#666", - fontFamily: "Helvetica Neue", + fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 12, fontStyle: "normal", maxRotation: 90,