score:3
Accepted answer
As @RC suggested remove min
and max
and then to get the actual step size working use stepSize
instead of unitStepSize
let myBubbleData = [{},{},{},{},{},{},{},{},{},{},{},{"x":1502531100000,"y":0.5,"r":3},{"x":1502532000000,"y":0.5,"r":3},{},{},{"x":1502534700000,"y":0.5,"r":6},{"x":1502535600000,"y":0.5,"r":3},{"x":1502536500000,"y":0.5,"r":3},{},{"x":1502538300000,"y":0.5,"r":3},{},{"x":1502540100000,"y":0.5,"r":3},{},{},{"x":1502542800000,"y":0.5,"r":6},{},{},{},{"x":1502546400000,"y":0.5,"r":3},{},{},{},{},{},{},{},{}];
let ctx = document.getElementById('test');
let myBubbleChart = new Chart(ctx,{
type: 'bubble',
data: {
animation: {
duration: 10000
},
datasets: [{
data: myBubbleData
}]
},
options: {
responsive: true,
title:{
display: true,
text:'Chart.js Bubble Chart'
},
scales: {
yAxes: [{
display: false,
position: 'left',
ticks: {
min: 0,
max: 1
},
gridLines : {
display : false
}
}],
xAxes: [{
type: 'time',
ticks: {
maxRotation: 90,
minRotation: 80
},
time: {
format: 'HH:mm',
tooltipFormat: 'HH:mm',
unit: 'minute',
stepSize: 15,
displayFormats: {
'minute': 'HH:mm',
'hour': 'HH:mm'
}
}
}]
}
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.bundle.min.js"></script>
<body>
<div>
<canvas id="test"></canvas>
</div>
</body>
Source: stackoverflow.com
Related Query
- UnitStepSize for regular time interval with Chartjs
- Chartjs random colors for each part of pie chart with data dynamically from database
- Chartjs - data format for bar chart with multi-level x-axes
- Add zoom event handler to charts for chartjs with chartjs-plugin-zoom
- How to remove bars for those bars with zero value in Chartjs bar chart?
- how to set color for each item in tooltip with ChartJS
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- Chartjs not working with d3 from csv source
- Time scale formatting issues with chartjs, mostly unitStepSize
- ChartJS xAxis time formats don't change for days
- How to create a custom tooltip for chartJS graph with data in JSON array in JavaScript?
- Chartjs Custom Legend with Time on Y-axis
- Remove animation time for chartjs datapoints
- Map JSON for Chartjs with Angular 7
- Issue with chartjs linear gradient for the mixed bar chart in ReactJS is not calculated for each individual Bars
- How to write better code in es6 for formatting an object with array values
- Problem with script src for Chart.js. The CDN for Chart.js funtions fine, so my code is ok. Somehow I'm not linking the file correctly
- ChartJS not showing data for time series bar chart
- How to set min max for x axis depend on data with Chartjs and Spring Boot?
- chartjs plot datetime value with time offset on the grid
- Updating Chartjs to 2.5 with custom code
- Two data sets with different time instances on the same ChartJs chart
- How to display multiple graphs in real time with chartjs
- ChartJS with ChartJS DataLabels: Change Color per Dataset for Value Labels
- Trouble with setting background color for Line chart at Chartjs version 3.5.1
- Can I use chartJS for drawing a stock map with rectangle?
- Chartjs 3.2 problem with setting whole numbers for Y axis
- Issues with Moment and ChartJS Time Format Parsing
- How to display a progress over time in one horizontally stacked bar with chartjs
- ChartJS with React: Only one value showing on time chart
More Query from same tag
- Customizing ChartJS.org
- chart.js v2: how to add tooltips of metadata?
- ChartJS adding 3yAxes
- How to replace the data array of my ChartJS
- Chart.js showing time (HH:MM:SS - 24 hour clock) on xAxis
- Chart.js - how to disable everything on hover
- How to plot a single value with line in line chart graph using charts.js?
- Line chart is not being displayed in Chart.js
- Using Chart.js, how do I avoid having tooltips overlap?
- How to set equal width between ticks - chartjs
- Why chart renders after second click - react-chartjs-2
- Draw line on Chart.js bar
- Average 2 Keys in ChartJS
- How to disable Chart.js Radar Chart point labels
- How to pass my array of objects into a graph with Chart.js
- Resize pie chart from chart.js
- React Chartjs - Update Chart on interval
- how to reset the graph/chart after zoomin, pan using chartjs
- Highlight chart element when hovering over its corresponding legend Item
- I am having this error in charts v3 chartjs-chart-treemap: fontColor does not exist in type 'ChartDataset<"treemap", TreemapDataPoint[]>
- Chart.js - Avoid line to goes to zero and remove dot for this situation
- AngularJS/ChartJS: Get the current series
- How to control visibility of canvas image via button outside the canvas(ChartJs)?
- Changing chart options dynamically in Chart.js
- How to draw lines between minimum and maximum value to average value in chartJS?
- How can I keep label string length from affecting size of a Polar Area chart?
- Chartjs custom dynamic legend overflowing
- Chart.js after ajax refresh there are two charts in the same container (new and old)
- chart-options not registering scaleStartValue
- In chart.js, how to know if a yAxes tick is bumping/rendering over/into another