mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 12:49:07 +02:00
Merge pull request #1964 from nnnick/feature/1954
Add default font options
This commit is contained in:
commit
25e787cbf0
@ -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: {},
|
||||
|
@ -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:
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user