score:6
This can be prevented by changing the y-axis label's font size on-the-fly (dynamically). Though, in ChartJS there is no built-in method to do so, meaning no matter how you resize the chart, the font size will always be the same.
However, to get around this, you can use the following chart plugin, which will make the font size responsive ...
plugins: [{
beforeDraw: function(c) {
var chartHeight = c.chart.height;
c.scales['y-axis-0'].options.ticks.fontSize = chartHeight * 6 / 100;
}
}]
add this plugin followed by your chart options.
Here is a working example on jsFiddle
score:1
You could add some CSS to stop the chart getting too small, forcing some users on mobile to scroll right: https://jsfiddle.net/panchroma/yybc26Lr/1/
The only change I made was add
.chart{
min-width:300px;
}
Source: stackoverflow.com
Related Query
- How I can prevent of labels overlapping on mobile screen Chart.js
- how can i modify scale labels in angular chart js?
- how can i show labels and value in both on bar chart
- How can labels/legends be added for all chart types in chart.js (chartjs.org)?
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- How do I prevent the scale labels from being cut off in chartjs?
- How can I make two of my lines in Chart JS thicker
- How to prevent first/last bars from being cut off in a chart with time scale
- Chart.js how to show cursor pointer for labels & legends in line chart
- How can I make a stepline or stepped chart in chart.js or D3?
- How to display Line Chart dataset point labels with Chart.js?
- How to display data labels outside in pie chart with lines in ionic
- How to align Chart.JS line chart labels to the center
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- How can I remove extra whitespace from the bottom of a line chart in chart.js?
- How to display the labels in doughnut chart using ng2 charts?
- Chart.js Radar Chart How to Remove Outer Labels
- Chart js: how can I align the legend and the title
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- How can I trigger the hover mode from outside the chart with charts.js 2?
- How can I add some text in the middle of a half doughnut chart in Chart.JS?
- How can I make line on chart thinner?
- ChartJs - Pie Chart - how to remove labels that are on the pie chart
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How to add images to chart labels with vue-chartjs?
- How can I rotate a pie chart in charts.js?
- CHART.JS How can I offset/move/adjust the labels on the y-axis to be in the middle of the gridlines instead of centered on the gridlines?
- How can I achieve displaying data points on chart but Dotted? Chart.js V3.7.0
- How to draw outer labels for polar chart using ng2-charts and chart.js at fixed positions outside the rings?
- Chart is too big. How can I reduce size for the chart in vue js?
More Query from same tag
- CharJs scrolling page on mobile
- Chart.js bar chart label gets hidden on hover
- How do I remove CSS code arriving in my webpage?
- angular-chart.js tickmark issue
- Typescript types for chartjs-adapter-date-fns
- Custom data in label on ChartJS pie chart
- Chart.js the point's limit supported
- Disable stacking for 1 dataset
- Chartjs Stacked bar chart not displaying correctly
- Set xAxes labels to format YYYY-MM-DD HH:mm:ss in Chart.js
- Chart.js set active segment on initialize
- Chart js Bar Time Chart
- Updating chart.js with JSON from Razor page
- dynamically update the scale type of chartjs graph
- [MIXED CHART.JS]animation option screws up chart.js
- hide data of the datasets in radar chart?
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- ChartJS: how to make a bar chart with a horizontal guideline:
- Prime NG Customise tool tip on Bar Chart
- Add Space Between Bars in Angularjs Chartjs
- Saving ChartJS chart showing all tooltips
- Chart.js tooltip at any point on the chart
- Laravel passing orders to Chart.js
- I search additive options on chartsjs
- Get value of min/lowest label from y-axis chart
- ChartJS Line chart causes browser crash
- JavaScript Error - Uncaught SyntaxError: Unexpected number
- How to use set the color for each bar in a bar chart using chartjs?
- How to make chartjs pie chart responsive
- how to update chartjs2 option (scale.tick.max)