score:0
The propertys have changed in naming in v3 see migration guide (https://www.chartjs.org/docs/master/getting-started/v3-migration) and the font docs (https://www.chartjs.org/docs/master/general/fonts) for more info:
Example:
var options = {
type: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
borderWidth: 1
},
{
label: '# of Points',
data: [7, 11, 5, 8, 3, 7],
borderWidth: 1
}
]
},
options: {
plugins: {
legend: {
labels: {
font: {
size: 20
},
color: 'red',
}
}
}
}
}
var ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);
<body>
<canvas id="chartJSContainer" width="600" height="400"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.0.0-beta.12/chart.js" integrity="sha512-KTkh8VBBRBzCXlXeR49sBgmLkU6CE7li47A70NR+yYMKGEDOfQR4L2PEQ3KRXeET8j1U+gSRpRjkAS4tQjTGag==" crossorigin="anonymous"></script>
</body>
Source: stackoverflow.com
Related Query
- Is there any way to change the font color and size of labels in Chartjs 3.0.0
- Is there any way to change the font size of labels in bar chart in Chart.js v3?
- Can't change the default color and font size of labels in react-chartjs-2
- Change font size and font color in Chartjs Angular 5
- Adjusting the font size and family of extra fillText labels in ChartJS
- chartjs datalabels change font and color of text displaying inside pie chart
- Change point size and color on hover in chartjs
- How to change the color of legend in chartjs and be able to add one more legend?
- Change font family of labels in piechart and linechart in chartjs
- Is there any way to use 2 different color for the same bar in a chart?
- Setting Common labels and background color common for all the charts in ChartJs
- Is there a way to change part of the title to another font style or set a custom title format in Chart.js?
- Is There any way to show image on top of the stacked bar, Am getting image on every color Instead of that i need only on top of each bar
- Change X and Y axis font color
- ChartJS – is there any way to remove blank space around pie charts?
- Chartjs change the specific label color in x axis in callback function
- Chartjs Radar - Change color of end point labels
- ChartJS click on bar and change it's background color
- unable to add background color to the canvas using jspdf and chartjs
- How to Increase the label font size and decrease the size of my pie using chart.js?
- How to change ChartJS font size with javascript?
- ChartJS - Finding the minimum and maximum labels that are inside a pan (When zooming)
- Is there a way to change color of a chart's grid in y-axis - ng2-charts
- How to change the fontFamily of the labels and remove the grid in chart.js
- Chart.js: Chaing Font Color and Size not working
- how to change display and styles of the labels in react-chartjs-2
- Is there any way to get y of specific x which not belongs to the dataset in Chart.js graph?
- Is there a way to change the react-chart-js tooltip only on a graph?
- In ChartJS how do I change the color of a label in the legend?
- Is there a way to give a pie chart in chart.js a different color outer border than the border color between segments?
More Query from same tag
- Some bars of the bar graph are disappearing from Chart.js
- How do I display two datasets on a single chart with chartjs
- How to set ChartJS x-axis title
- How to display a barchart in chart.js?
- Chartjs hide dataset legend v3
- Chart.js how to make chart only show the most recent data
- Move tooltip further from data point for Chart.js?
- Chartjs - legends take up too much space on mobile devices
- Getting data into script tag from route?
- Difficulty in using php json_encode data received in javascript to display graph using chart.js library
- Angular-Charts - Pie Chart,show labels inside each slice of data
- Chart.js I want to fix my xAxis to my yAxis position 0
- Display Chart.js chart in Node.js
- Chart js v2 tooltip callback line breaks
- Problem to create dynamic pie chart in ChartJS
- Chart.js - Increase spacing between bottom legend and chart
- How to make dynamic chart js using JSON in Codeigniter?
- How to can I get text inside a chats.js circular chart
- Two independent time axes in Chart.js
- How to make the size of pie chart fixed without using canvas (chart.js)
- jquery load with chart.js
- Chart.js 2 - Axis Layer Padding
- Display JSON data in chartjs
- ChartJS customize left and bottom axe border
- How do I use the return values from csv ajax request for x and y values?
- Problem for display a chart with Chart.js and Angular
- Understanding Chart.js and Adding Legends to Pie Charts
- Chart.JS spacing and padding
- Chart.js error: Bar is not a function
- Chart.js - Uncaught ReferenceError: chart is not defined