score:0
while sending data from the server, you can send min and max value as well, and then use suggestedmin
and suggestedmax
yaxes: [{
ticks: {
suggestedmin: receivedminval - 10,
suggestedmax: receivedmaxval + 10,
}
}
}]
where received val
refers to the value sent from the server. you can also use a js function to find the min and max values from the array. suggested values will always increase the value by keeping the ratio of stepsize.
if you would like to learn more about this, read the documentation. you could read all about it at https://www.chartjs.org/docs/latest/axes/cartesian/linear.html#axis-range-settings
Source: stackoverflow.com
Related Query
- Boxplot chartjs make min and max dynamic by leaving some space on both side
- Chartjs v2.5 - only show min and max on scale, absolute positioning on scale
- Setting up min and max in chartjs did not work
- ChartJS automatically scaled chart has undefined min and max
- How to set min max for x axis depend on data with Chartjs and Spring Boot?
- Chartjs gradient background color based on min and max values
- How to set max and min value for Y axis
- ChartJS: How to set fixed Y axis max and min
- Chart.js timescale: set min and max on xAxes
- Hide min and max values from y Axis in Chart.js
- Chartjs: how to show only max and min values on y-axis
- Chart.js and right side free space
- Make y-axis sticky when having horizontal scroll on chartJS and Angular
- How do I force Chart.js axes min and max with react-chartjs-2?
- Remove additional white space on left and right side of Angular Chart
- How to set max smaller than min in ChartJS
- How to set the xAxes min and max values of time cartesian chart in Chart.js
- Chartjs dynamic chart return both x & y axis undefined
- Bar chart with min height and zero values - ChartJs
- how to increase space between legend and chart in chartjs (ng2charts ) using angular
- Make chartjs pie chart wiyh dynamic data
- Setting min and max values chart.js
- How to make a chart with chartjs and Angular?
- Chartjs bar min, max and avarage value
- Chart.js - Same min and max value of two charts
- ChartJs: x-axes min and max value not working
- VueJS and dynamic reload ChartJS when screen resize
- chart.js how to force min and max y axis values
- How can I move chartJs legend left side and change the width and Hight of the chart?
- Chartjs and dynamic data arrays
More Query from same tag
- chart.js with json data and jquery - error :-(
- Display values outside of pie chart in chartjs
- ChartJS AJAX load labels and data
- How to filter chart.js by month
- vb.net string to chartjs data field?
- Chart.js: scrollable/swipable time-based x-axis
- Chart js custom single tooltip not working
- Charts.js in Angular 7 - working with imported time for timeseries
- How can I cause a legend to appear to the right of the pie (Chart.JS)?
- Charts.js destroy previous data and update
- How to make a step line with charts.JS
- Not able to remove legent from Radar Chart in chart.js even using legent: {display : false}
- How is it possible to make curved bar chart or curved column charts in chart.js?
- How to disable converting decimal number to exponential?
- Label issue in doughnut chart using chartjs
- Chart.js label value
- Chart.js Chart does not start at
- Angular-ChartJs : Use a service inside a custom tooltip of a graphic chartJs
- Chart.js margins
- Clojurescript/Reagent/Chart.js - Reagent life cycle - chart.update()
- Chart.js render problem when routing Angular
- Chartjs with Backbone
- Chart.js stepsize with multiple yAxis scales
- chartjs-plugin-dragdata isn''t working with scatter charts
- Charts.js legend more than view value
- Chart.js: How can I manually set Y-axis range?
- Chart won't draw. Returning a string value not a Number value - Meteor - Chartjs
- How do i have a single Chart.vue component instead of different chart components and then display charts from it by changing id of the API
- Display labels on bar chart using Chart.js
- Not being able to display value from json data into chart js