Merge pull request #1964 from nnnick/feature/1954

Add default font options
This commit is contained in:
Evert Timberg 2016-02-01 21:12:11 -05:00
commit 25e787cbf0
12 changed files with 44 additions and 40 deletions

View File

@ -87,6 +87,10 @@
}, },
onClick: null, onClick: null,
defaultColor: 'rgba(0,0,0,0.1)', 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 // Element defaults defined in element extensions
elements: {}, elements: {},

View File

@ -22,10 +22,10 @@
labels: { labels: {
boxWidth: 40, boxWidth: 40,
fontSize: 12, fontSize: Chart.defaults.global.defaultFontSize,
fontStyle: "normal", fontStyle: Chart.defaults.global.defaultFontStyle,
fontColor: "#666", fontColor: Chart.defaults.global.defaultFontColor,
fontFamily: "Helvetica Neue", fontFamily: Chart.defaults.global.defaultFontFamily,
padding: 10, padding: 10,
// Generates labels shown in the legend // Generates labels shown in the legend
// Valid properties to return: // Valid properties to return:

View File

@ -22,10 +22,10 @@
// scale label // scale label
scaleLabel: { scaleLabel: {
fontColor: '#666', fontColor: Chart.defaults.global.defaultFontColor,
fontFamily: 'Helvetica Neue', fontFamily: Chart.defaults.global.defaultFontFamily,
fontSize: 12, fontSize: Chart.defaults.global.defaultFontSize,
fontStyle: 'normal', fontStyle: Chart.defaults.global.defaultFontStyle,
// actual label // actual label
labelString: '', labelString: '',
@ -37,10 +37,10 @@
// label settings // label settings
ticks: { ticks: {
beginAtZero: false, beginAtZero: false,
fontSize: 12, fontSize: Chart.defaults.global.defaultFontSize,
fontStyle: "normal", fontStyle: Chart.defaults.global.defaultFontStyle,
fontColor: "#666", fontColor: Chart.defaults.global.defaultFontColor,
fontFamily: "Helvetica Neue", fontFamily: Chart.defaults.global.defaultFontFamily,
maxRotation: 90, maxRotation: 90,
mirror: false, mirror: false,
padding: 10, padding: 10,

View File

@ -10,9 +10,9 @@
position: 'top', position: 'top',
fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes) fullWidth: true, // marks that this box should take the full width of the canvas (pushing down other boxes)
fontColor: '#666', fontColor: Chart.defaults.global.defaultFontColor,
fontFamily: 'Helvetica Neue', fontFamily: Chart.defaults.global.defaultFontFamily,
fontSize: 12, fontSize: Chart.defaults.global.defaultFontSize,
fontStyle: 'bold', fontStyle: 'bold',
padding: 10, padding: 10,

View File

@ -11,21 +11,21 @@
custom: null, custom: null,
mode: 'single', mode: 'single',
backgroundColor: "rgba(0,0,0,0.8)", backgroundColor: "rgba(0,0,0,0.8)",
titleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", titleFontFamily: Chart.defaults.global.defaultFontFamily,
titleFontSize: 12, titleFontSize: Chart.defaults.global.defaultFontSize,
titleFontStyle: "bold", titleFontStyle: "bold",
titleSpacing: 2, titleSpacing: 2,
titleMarginBottom: 6, titleMarginBottom: 6,
titleColor: "#fff", titleColor: "#fff",
titleAlign: "left", titleAlign: "left",
bodyFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", bodyFontFamily: Chart.defaults.global.defaultFontFamily,
bodyFontSize: 12, bodyFontSize: Chart.defaults.global.defaultFontSize,
bodyFontStyle: "normal", bodyFontStyle: Chart.defaults.global.defaultFontStyle,
bodySpacing: 2, bodySpacing: 2,
bodyColor: "#fff", bodyColor: "#fff",
bodyAlign: "left", bodyAlign: "left",
footerFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", footerFontFamily: Chart.defaults.global.defaultFontFamily,
footerFontSize: 12, footerFontSize: Chart.defaults.global.defaultFontSize,
footerFontStyle: "bold", footerFontStyle: "bold",
footerSpacing: 2, footerSpacing: 2,
footerMarginTop: 6, footerMarginTop: 6,

View File

@ -36,16 +36,16 @@
pointLabels: { pointLabels: {
//String - Point label font declaration //String - Point label font declaration
fontFamily: "'Arial'", fontFamily: Chart.defaults.global.defaultFontFamily,
//String - Point label font weight //String - Point label font weight
fontStyle: "normal", fontStyle: Chart.defaults.global.defaultFontStyle,
//Number - Point label font size in pixels //Number - Point label font size in pixels
fontSize: 10, fontSize: 10,
//String - Point label font colour //String - Point label font colour
fontColor: "#666", fontColor: Chart.defaults.global.defaultFontColor,
//Function - Used to convert point labels //Function - Used to convert point labels
callback: function(label) { callback: function(label) {

View File

@ -226,7 +226,7 @@ describe('Core helper tests', function() {
position: "right", position: "right",
scaleLabel: { scaleLabel: {
fontColor: '#666', fontColor: '#666',
fontFamily: 'Helvetica Neue', fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: 'normal', fontStyle: 'normal',
labelString: '', labelString: '',
@ -235,7 +235,7 @@ describe('Core helper tests', function() {
ticks: { ticks: {
beginAtZero: false, beginAtZero: false,
fontColor: "#666", fontColor: "#666",
fontFamily: "Helvetica Neue", fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: "normal", fontStyle: "normal",
maxRotation: 90, maxRotation: 90,
@ -264,7 +264,7 @@ describe('Core helper tests', function() {
position: "left", position: "left",
scaleLabel: { scaleLabel: {
fontColor: '#666', fontColor: '#666',
fontFamily: 'Helvetica Neue', fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: 'normal', fontStyle: 'normal',
labelString: '', labelString: '',
@ -273,7 +273,7 @@ describe('Core helper tests', function() {
ticks: { ticks: {
beginAtZero: false, beginAtZero: false,
fontColor: "#666", fontColor: "#666",
fontFamily: "Helvetica Neue", fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: "normal", fontStyle: "normal",
maxRotation: 90, maxRotation: 90,

View File

@ -25,7 +25,7 @@ describe('Category scale tests', function() {
position: "bottom", position: "bottom",
scaleLabel: { scaleLabel: {
fontColor: '#666', fontColor: '#666',
fontFamily: 'Helvetica Neue', fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: 'normal', fontStyle: 'normal',
labelString: '', labelString: '',
@ -34,7 +34,7 @@ describe('Category scale tests', function() {
ticks: { ticks: {
beginAtZero: false, beginAtZero: false,
fontColor: "#666", fontColor: "#666",
fontFamily: "Helvetica Neue", fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: "normal", fontStyle: "normal",
maxRotation: 90, maxRotation: 90,

View File

@ -24,7 +24,7 @@ describe('Linear Scale', function() {
position: "left", position: "left",
scaleLabel: { scaleLabel: {
fontColor: '#666', fontColor: '#666',
fontFamily: 'Helvetica Neue', fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: 'normal', fontStyle: 'normal',
labelString: '', labelString: '',
@ -33,7 +33,7 @@ describe('Linear Scale', function() {
ticks: { ticks: {
beginAtZero: false, beginAtZero: false,
fontColor: "#666", fontColor: "#666",
fontFamily: "Helvetica Neue", fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: "normal", fontStyle: "normal",
maxRotation: 90, maxRotation: 90,

View File

@ -23,7 +23,7 @@ describe('Logarithmic Scale tests', function() {
position: "left", position: "left",
scaleLabel: { scaleLabel: {
fontColor: '#666', fontColor: '#666',
fontFamily: 'Helvetica Neue', fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: 'normal', fontStyle: 'normal',
labelString: '', labelString: '',
@ -32,7 +32,7 @@ describe('Logarithmic Scale tests', function() {
ticks: { ticks: {
beginAtZero: false, beginAtZero: false,
fontColor: "#666", fontColor: "#666",
fontFamily: "Helvetica Neue", fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: "normal", fontStyle: "normal",
maxRotation: 90, maxRotation: 90,

View File

@ -29,7 +29,7 @@ describe('Test the radial linear scale', function() {
lineArc: false, lineArc: false,
pointLabels: { pointLabels: {
fontColor: "#666", fontColor: "#666",
fontFamily: "'Arial'", fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 10, fontSize: 10,
fontStyle: "normal", fontStyle: "normal",
callback: defaultConfig.pointLabels.callback, // make this nicer, then check explicitly below callback: defaultConfig.pointLabels.callback, // make this nicer, then check explicitly below
@ -37,7 +37,7 @@ describe('Test the radial linear scale', function() {
position: "chartArea", position: "chartArea",
scaleLabel: { scaleLabel: {
fontColor: '#666', fontColor: '#666',
fontFamily: 'Helvetica Neue', fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: 'normal', fontStyle: 'normal',
labelString: '', labelString: '',
@ -49,7 +49,7 @@ describe('Test the radial linear scale', function() {
backdropPaddingX: 2, backdropPaddingX: 2,
beginAtZero: false, beginAtZero: false,
fontColor: "#666", fontColor: "#666",
fontFamily: "Helvetica Neue", fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: "normal", fontStyle: "normal",
maxRotation: 90, maxRotation: 90,

View File

@ -28,7 +28,7 @@ describe('Time scale tests', function() {
position: "bottom", position: "bottom",
scaleLabel: { scaleLabel: {
fontColor: '#666', fontColor: '#666',
fontFamily: 'Helvetica Neue', fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: 'normal', fontStyle: 'normal',
labelString: '', labelString: '',
@ -37,7 +37,7 @@ describe('Time scale tests', function() {
ticks: { ticks: {
beginAtZero: false, beginAtZero: false,
fontColor: "#666", fontColor: "#666",
fontFamily: "Helvetica Neue", fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
fontSize: 12, fontSize: 12,
fontStyle: "normal", fontStyle: "normal",
maxRotation: 90, maxRotation: 90,