score:2
Accepted answer
You can use a custom label formatter to display time values instead of numbers.
times = [
"3:00 am",
"7:00 am",
"11:00 am",
"3:00 pm",
"7:00 pm",
"11:00 pm",
]
public bubbleChartOptions: ChartOptions = {
responsive: true,
scales: {
xAxes: [{ ticks: { min: 0, max: 30, } }],
yAxes: [{
ticks: {
min: 0, max: 5,
callback: value => this.times[value]
}
}]
}
};
public bubbleChartData: ChartDataSets[] = [
{
data: [
{ x: 7, y: 0, r: 8 },
{ x: 10, y: 1, r: 10 },
{ x: 15, y: 2, r: 15 },
{ x: 26, y: 3, r: 23 },
],
label: 'Series A',
},
];
See this stackblitz for example.
Here's the image output:
Source: stackoverflow.com
Related Query
- Display Time In Y Axis - Bubble Chart
- Chart JS - set start of week for x axis time series
- Chart.js Dynamically Updating Chart with X Axis Time
- Category scale on Y-axis and time on x-axis in bubble chart in Chartjs
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- display vertical axis label in line chart using chart.js
- chart js - bar chart with time scale on Y axis in Hours and Minutes
- Chart with Time axis only displaying first grid line and tick label (unitStepSize)
- Chart.js 2 - Always display only some tooltips in bubble chart
- How to use chart.js to plot line chart with x axis as time stamp in seconds
- Time chart labels with some X axis labels using Chart js v3
- Chart.js bar chart with time on X axis and category on Y axis is not rendered
- Charts.js - Bubble chart with two word axis
- Chart is not rendering properly time axis
- How to set max/min on x axis to display time range in Chart.js?
- hereChartJS Line Chart with Time Axis
- 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
- ChartJs line chart time cartesian axis number of ticks and wierd offset
- The real time chart sometimes does not display when I switch the target
- Chart.js line chart display decimal values on Y axis
- Chart for Real time data with duplicate x axis
- 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
- How to prevent first/last bars from being cut off in a chart with time scale
- Chart Js change text label orientation on Ox axis
- Chart JS - Use time for xAxes
- Display line chart with connected dots using chartJS
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Chart js display empty plot
- How to display Line Chart dataset point labels with Chart.js?
More Query from same tag
- how can i add value on bar in the charts in chart.js vs 3.x
- How to rotate a linear graphic in chart.js?
- How can I draw a line to the highest datapoint in chart js?
- Add border to Chart.js tooltips
- Customization of Data Labels in doughnut chart ng2-charts
- Problems displaying yLabels in charts.js
- Which is the appropriate lifecycle hook to draw a line?
- Chart JS title passed from Django - issue with apostrophe '
- displaying the output on chart.js using Django and HTML
- Calling external Chartjs chart from a javascript file into HTML in Flask
- setting uneven tick stepsize spacing with chart.js
- Chart JS, ng2-Charts - How to make the label to the right of pie chart instead on top?
- ChartJs days of the week from numbers
- Javascript Chart.js scale fix
- chart.js dynamically add y axes from json
- how to modify and make labels box width fixed without changes of chart.js
- How to draw vertical axis in google charts
- Can I arrange labels of legend in Doughnut chart one by one?
- ChartJS does not work on Windows 10 - in any browser
- How to add horizontal scroll to a bar graph in chartjs?
- Adding space to begin of xAxis ticks in chartJS
- How to keep side bars in Chartjs bar graph from clipping?
- Time chart labels with some X axis labels using Chart js v3
- Angular - change objects to array and make it listen to on change
- Chart.JS fixing maximum and minumum to a location on screen
- Change 'points' on a line chart to donuts using Chart.js
- Chart.js doughnut animate/draw clockwise
- chartjs dataset from single line to multiple line
- Canvas is not defined for simple chart
- chart.js - user add the final point of the line