score:7
Accepted answer
This can be done using the major ticks option in chartjs.
scales: {
xAxes: [{
type: 'time',
time: {
unit: 'hour',
stepSize: 3, // I'm using 3 hour intervals here
tooltipFormat: 'HH:mm',
},
ticks: {
major: {
enabled: true, // <-- This is the key line
fontStyle: 'bold', //You can also style these values differently
fontSize: 14 //You can also style these values differently
},
},
}]
}
This produces an x axis like the follwong
Source: stackoverflow.com
Related Query
- Chart.js hours scale show day switch
- how to minimize x axis labels to day hours in chart js
- chartjs show 24 hours in line chart
- chart js - bar chart with time scale on Y axis in Hours and Minutes
- Chart.js Show labels on Pie chart
- How to prevent first/last bars from being cut off in a chart with time scale
- chart.js: Show labels outside pie chart
- ChartJS - Draw chart with label by month, data by day
- Chart.js how to show cursor pointer for labels & legends in line chart
- chartjs : how to set custom scale in bar chart
- show label in tooltip but not in x axis for chartjs line chart
- chartjs show dot point on hover over line chart
- Chart JS Show HTML in Tooltip
- Chart Js Negative Scale
- chart js tooltip how to control the data that show
- How to show percentage (%) in chart js
- Show X axis on top and bottom in line chart rendered with Chart.js 2.4.0
- Chart looks only grey, does not show the color - Chartjs,discordjs
- Chart JS show multiple data points for the same label
- Show data dynamically in line chart - ChartJS
- Category scale on Y-axis and time on x-axis in bubble chart in Chartjs
- chart.js switch x/y axis on line chart
- Chartjs - show elements in all datasets on hover using bar chart
- Remove the label and show only value in tooltips of a bar chart
- Chart Js Show the old data on mouse hover
- set y-axis scale manually in a bar chart using angular-chart.js
- ChartJS: Show all labels of a mixed chart in the tooltip
- Show all values in Chart js y axis
- PrimeNg bar chart how to show a label for the y-axis
- impossible to remove scale from radar chart (chart.js)
More Query from same tag
- Chart.js not displaying on Android Webview if animation is set to false
- chart.js with null data point in dataset
- Is it possible to combine multiple charts in one canvas in chartjs?
- Does this library have a way of showing a world map?
- laravel-chartjs not displaying anything
- chart.js remove lower grid from mixed chart
- Make labels of ChartJS radar in a few rows
- Chart JS tooltip appears differently when set from script instead of html
- How to set a length difference in chart?
- Chart.js v3 after using of zoom plugin instance persist in memory
- ChartsJS Annotations Plugin - Can you create a tooltip to accompany an annotation?
- Change color of X axis values to multi color values - Chart.js
- Chart.js animations ignoring global default configuration
- React render Chart.js based on api response
- How to compare one value to another in chartJS
- Change mouse cursor to pointer in charts js
- Putting label array to the chartjs?
- Chart js error in angular: Canvas is already in use. Chart with ID '0' must be destroyed before the canvas can be reused. Fix?
- Draw asynchronous information on a graph with VueJS
- Not drawing null values using chart.js
- Loading an external JSON into ChartJs
- How to make rectangle in chart.js
- How can I change the legend label without affecting my tooltip label?
- Data Visualization DataTables.js using chart.js
- chart.js color not rendering
- Chart.js two categorical scales
- chart.js how to display max value?
- Manipulate chart.js based plots in R (radarchart)
- Chart.js v2 - Partial Y -grid lines with bar chart
- Retrieve value returned from a function in Angular