score:1
Accepted answer
i think you are using data string as the label so any built-in logic is not going to work.
you can create labels dynamically based on the selected date range and interval.
var labels = [];
// get interval
var interval = 5;
//get start date
var date_start = new date("july 5");
for ( var i = 0; i <= 30; i += interval) {
//set date
date_start.setdate(date_start.getdate() + interval);
//get month
var month_name = date_start.tolocalestring(navigator.language, { month: "short" });
//add to labels
labels.push(month_name + " " + date_start.getdate());
}
Source: stackoverflow.com
Related Query
- How do I change the 'months' language displayed on the date axis in Chart JS?
- How to change text colour of specific labels of axis in Chart JS?
- Chart Js change text label orientation on Ox axis
- How to change X-Axis Interval on Chart.js
- Chart js. How to change font styles for "labels" array?
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- how to change Y axis value dynamically based on user input in Chartjs for Line chart?
- Chart.js How to change y axis title position
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- How to change Chart.js horizontal bar chart Width?
- How to change z-index of chart js tooltip?
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- Change Axis Line color in Chart created using chart.js
- Chartjs 3.x - How to duplicate X axis on both sides of horizontal bar chart with only 1 dataset?
- How to change the label and grid line position on a timeseries chart in Chart.js 3?
- How to Remove axis Lines from chart in chart js
- How to change color of column in chart js
- How change chart height in chart.js
- angular-chart.js doughnut chart : How do I change width of the arc of a doughnut?
- how to minimize x axis labels to day hours in chart js
- how to label axis within radar chart with chart.js
- How to change fonts and axis labels for Chart.js image rendering with QuickChart?
- chart.js: How do I make the radar chart axis labels bigger?
- How to change axis font in PrimeFaces and Chart.js
- How to change the chart line or area colors according to the user need?
- How to stop axis label from being cut off in chart JS?
- How to change background color of labels in line chart from chart.js?
- How to change default label of each bubble in bubble chart using chartjs-plugin-datalabels
- How to change font weight of footer in tooltips in Chart JS
- How to change chart.js axis labels color?
More Query from same tag
- Series Details Not Showing in Angular Chart with Charts.js
- How I can add the predict data and the actual data in the same graph with ChartJS?
- Vue.js Vue-chart.js linear gradient background fill
- How to chart missing data in chartjs
- Chart.js scale x values
- math.max() doesn't work in IE
- Rails dual axis using Chartkick and chart js
- How to get line x value from Label chart js
- Possible to create quadrant chart with ChartJS, with the "origin" centered at a single point?
- Chartjs Bar Chart Legend
- The data that is called in chart does not match the database
- ChartJS - TypeError: Cannot read property '_model' of null - Angular
- how to setting chart js customization
- Is it possible to add a custom font to chart js?
- Generate Chart With 2 Datasets Charts.js
- Grouping y-axis labels on multiple lines on a ChartJS with an extra dimension
- Lift the bar up from the bottom in bar type chart
- Change color of X and Y axis values in Chart.js
- Chart.js not showing dynamically populated data
- Make the X-Axis labels in chart.js increment by a certain scale
- How to fetch data from Json file on charts(bar-chart/pie chart etc) in angular?
- Place two canvases side by side in a div
- How to customize percentage label in Doughnutchart ng2 chart.js
- Configuring locale with bundled (CDN) chartjs-adapter-date-fns.bundle.min.js?
- How to set plural label values in chart.js
- How to implement chart.js in Django?
- Can Chart.js combines Line Chart and Bar Chart in one canvas
- Are you able to offset a secondary y-axis in ChartJS, by a decimal value, whilst keeping the same scale for both y-axes?
- How to parse time 'HH:MM:SS' and display steps on xAxis every minute in Chart.js
- passing each element of array in the labels of char.js