]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add default font options 1964/head
authorEvert Timberg <evert.timberg@gmail.com>
Tue, 2 Feb 2016 02:06:54 +0000 (21:06 -0500)
committerEvert Timberg <evert.timberg@gmail.com>
Tue, 2 Feb 2016 02:06:54 +0000 (21:06 -0500)
12 files changed:
src/core/core.js
src/core/core.legend.js
src/core/core.scale.js
src/core/core.title.js
src/core/core.tooltip.js
src/scales/scale.radialLinear.js
test/core.helpers.tests.js
test/scale.category.tests.js
test/scale.linear.tests.js
test/scale.logarithmic.tests.js
test/scale.radialLinear.tests.js
test/scale.time.tests.js

index 31460f4feec31a6ce2c253803ce3916f63db5073..8c4bda98e5559183f5ac905ddfd5dbf6e1bb4eef 100755 (executable)
                        },
                        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: {},
index 860249487ef8de06ed6540f1ee025d9730135e97..a91cf43763be396abfb11faa765f1f84bd4bcc6b 100644 (file)
 
                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:
index 721ea1f3a8fb6a2e976b26467b83f97c57ba2af5..b364bad13f92cb15f1c55c89f4f04c5614f59c59 100644 (file)
 
                // 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: '',
                // 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,
index 42ed8b54f8665e0122520bf20a6b10127f739dda..03a4903ac951508fa430772af5621761aac692ec 100644 (file)
@@ -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,
 
index 37a43e5d398f985a0e2db40f93c12c2f6be48e1e..ad3e17b73342e3cb46fe9f07ba8d34775e0ae666 100644 (file)
                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,
index beda63dae7d6414863cab35dead4a8dc1d3fe584..1bfa64c61f652258a1ad3d9926278e0ea856b90d 100644 (file)
 
                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) {
index 0e18c7a5cb61c58a705ddd88028b5ac0daee3769..224cc83f2b768c12f8da1bdccd8fd368e7bf0048 100644 (file)
@@ -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,
index 935ed604e167f45f41d4ddd85754d7a96aa6fe8c..6389853ad4031b2b3b3b1df96dfdff30fcf3acef 100644 (file)
@@ -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,
index a8b9738f9ae4a416bf65d139692abd0f6f68f565..a838da7e579371f21e95231788fc2718a8a5dc6f 100644 (file)
@@ -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,
index b3bda00c7743a82b55d29522b3910a8ce2331354..8f5df265678e5290c799538ffd3f4e8965f07ec1 100644 (file)
@@ -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,
index e9ae118b28b594211ba5eacaec2ada0d4b607f17..784dde0327d6ea5c28cc6a0834627ad2b0a5d9ee 100644 (file)
@@ -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,
index 87155deeaf7c11f600f1c0593b707d7d02859fae..777e63ce938ca71c77c27c2d4ffcceb595f2717e 100644 (file)
@@ -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,