score:25
Accepted answer
Add ticks.fontFamily to xAxes so it will look like this:
xAxes: [{
gridLines: {
display: false
},
ticks: {
fontFamily: "Verdana",
}
}],
Documentation: http://www.chartjs.org/docs/#scales
Example on jsfiddle: http://jsfiddle.net/4asLpwd5/
score:5
From version 3.x, onwards the syntax was changed.
Chart.js migration guide: 3.x Migration Guide
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
type: 'line',
data: chartData,
options: {
responsive: true,
plugins: {
legend: {
display: false,
}
},
scales: {
x: {
grid: {
display: false
},
ticks: {
font: {
family: 'Raleway', // Your font family
size: 14,
},
},
},
y: {
beginAtZero: true,
ticks: {
font: {
family: 'Raleway', // Your font family
size: 14,
},
// Include a dollar sign in the ticks
callback: function (value, index, values) {
return '$' + value;
},
},
}
}
}
});
Source: stackoverflow.com
Related Query
- Changing fontFamily on ChartJS bar chart
- Chartjs Bar Chart showing old data when hovering
- Chartjs v2.0: stacked bar chart
- Chart.js: Dynamic Changing of Chart Type (Line to Bar as Example)
- chartjs : how to set custom scale in bar chart
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Chartjs Bar Chart Legend
- Click event on stacked bar chart - ChartJs
- ChartJS add tooltip to a grouped bar chart
- Changing cursor to pointer on Chart.js bar chart when hover (mousemove) event is disabled?
- ChartJS bar chart with legend which corresponds to each bar
- ChartJs bar chart - keep bars left instead of equally spread across the width
- Border radius for the bar chart in ChartJS
- Chartjs - data format for bar chart with multi-level x-axes
- Chartjs - show elements in all datasets on hover using bar chart
- Line chart is showing under bar in combochart in chartjs
- How to draw Horizontal line on Bar Chart Chartjs
- Grouping the object by key for Chartjs bar chart
- Multiple stacked bar chart using ChartJs
- ChartJS bar chart fixed width for dynamic data sets
- Stacked bar chart starting from 0 - ChartJS React
- Negative bar chart of highcharts in chartjs
- Remove padding from chartJs horizontal bar chart
- Grouped Bar Chart from mySQL database using ChartJS and PHP
- Minimum value for x Axis doesn't work for horizontal bar chart | ChartJS
- Chartjs - Set start and end value into a Bar Chart
- ChartJS horizontal chart display legend on each bar
- Bar Chart of ChartJS does not Render
- Chartjs 3.x - How to duplicate X axis on both sides of horizontal bar chart with only 1 dataset?
- Chartjs numbers on bar chart flash on hover
More Query from same tag
- JavaScript. Find the sum of a certain parameter in an array to produce a popup if that sum == 0
- how to render the same chart using Chart.js
- Pie Chart Legend - Chart.js
- How to change default label of each bubble in bubble chart using chartjs-plugin-datalabels
- Using chart.js version 1.0.2 and 2.0 together
- Multiple Chart.js Charts in Partial Views Overwriting Each Other
- React-chartjs not working
- Chart.js the point's limit supported
- Chart.js - Mixed Chart: Bar Graph with Diagonal Line
- hover/mouseover not activated on every move inside element
- How to show tooltip on legend hover?
- how to show A2, B2, C2 labels using chartjs 3.2.0?
- Is it possible to draw a bar and arrow/pointer on the right side of a chart?
- How can I user microseconds in ChartJs?
- Show point values in Radar Chart using chart.js
- Combo line and bar chart. how can i render line in middle
- Angular 2 ng2-charts donut add horizontal line
- Get Value for point clicked on Pie Chart in Chart.js 3
- I can't import ChartsModule
- Javascript object from string
- jQuery convert hex to rgba
- opening json file to create chart in chart.js
- Laravel - Leave status is giving wrong result in chartjs BarChart
- Change color of Polar Area datasets in Angular
- Save data from REST API Get method and use it one more time
- ChartJS Datalabels plugin and negative numbers
- Javascript array not initialized
- Chart JS Not Displaying Chart
- Using associative PHP array in JS to later on use in chart generated via chart.js
- Chart.js scatter plot fill portions of chart based on value