score:10
Accepted answer
So chartjs is creating the x-axis labels dynamically and decided it can show two labels per day, which when formatted end up showing two dates that are the same.
Pass a new field unit
to the time
object and set it to day
. this will cause the chart to only show one tick per day in the time frame. (example fiddle)
options: {
scales: {
xAxes: [{
type: 'time',
time: {
unit: 'day',
}
}],
},
}
Source: stackoverflow.com
Related Query
- Chart js x-axis values getting repeated twice
- Show all values in Chart js y axis
- Hovering over chart.js values in Meteor onRendered function causes chart axis shift
- chart is not getting updated from the values it received from Jquery
- How to set custom Y Axis Values (Chart.js v2.8.0) in Chart Bar JS
- How to start Y Axis Line at 0 from right for negative values in chart js 2?
- getting additional value fields from data source for dx.chartjs doughnut chart
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Set minimum and maximum axis values on chart
- Getting the HTML code of a chart created by chart.js
- Getting x,y values from chart click event
- Chart.js line chart display decimal values on Y axis
- Dynamically update values of a chartjs chart
- In Chart.js set chart title, name of x axis and y axis?
- ChartJS New Lines '\n' in X axis Labels or Displaying More Information Around Chart or Tooltip with ChartJS V2
- Change color of X and Y axis values in Chart.js
- Chart Js change text label orientation on Ox axis
- line chart with {x, y} point data displays only 2 values
- Chart JS data labels getting cut
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Hide min and max values from y Axis in Chart.js
- show label in tooltip but not in x axis for chartjs line chart
- Chart.js v2.6: Add arrows to pie chart output values
- Chart JS - set start of week for x axis time series
- Display values outside of pie chart in chartjs
- How to display inline values in a stacked bar chart with Chart.js?
- Show X axis on top and bottom in line chart rendered with Chart.js 2.4.0
- Chart.js Timeseries chart - formatting and missing data values
- Chart.js Dynamically Updating Chart with X Axis Time
- How do I change the 'months' language displayed on the date axis in Chart JS?
More Query from same tag
- ChartJs bar not showing up
- Dashed line for missing data in Chart.JS (spanGaps style)
- Pie chart.js - show all 3 segment borders
- ChartJS legend background color while using point styles
- Horizontally align Chart.js y axes
- Using Chart.js with Gatsby markdown
- Is there a more optimized way to implement the change function of chart js upon changing the dropdowns?
- How to change font size, padding of chart title only, in chart.js 3.x
- Dynamically add charts with chart.js
- Format array output to be readable by chartjs in Laravel
- Why are these 2.9 ChartJS bar charts different?
- Reduce space between ticks in horizontal bar-chart chartJS
- Highlight last clicked bar in ChartJS
- How to change the angle of x axis ticks dynamically based on size of name?
- how to use chart.js with react Hook?
- How to get percentage from data collected in ChartJS?
- Chart.js addData is undefined when using SignalR
- .datasets is undefined when trying to access bars from chart.js
- Angular CharJS option tooltip label did not work
- ChartJS change background color by conditions
- How to access specific data values from tooltip - Chart.js
- Creating a horizontal bar chart extension on Chart.js
- Chartjs unexpected resize and crop after updating data. Using laravel blade view and Livewire
- ChartJS ticks values are not correct
- Chart.js – how to remove data entries from the tooltip?
- How to style specific gridlines differently in chartJs?
- How to add background color for doughnut mid using chart,js
- Chart.js multiple columns of data for the same label
- Remove radar chart labels in chart.js
- How to change the color of y axis labels in different color in Chart.js