score:12
Accepted answer
There is callback method in which you can get the array of values which will show on yAxes.
The first element of that array will be the highest value for the yAxes. Below is the sample code for the same.
var yAxesticks = [];
var highestVal;
var chartInstanceHoverModeNearest = new Chart(ctx, {
type: 'bar',
data: data,
options:{
scales: {
yAxes : [{
ticks : {
beginAtZero : true,
callback : function(value,index,values){
yAxesticks = values;
return value;
}
}
}]
}
}
});
highestVal = yAxesticks[0];
Source: stackoverflow.com
Related Query
- Obtain max value of y axis of line chart rendered with Chart.js
- Chart.js with line chart and bar chart - bar chart not rendered although the max value of it is shown
- Show X axis on top and bottom in line chart rendered with Chart.js 2.4.0
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- Line chart with large number of labels on X axis
- Map event position to y axis value in chartjs line chart
- Chart.js two y axes line chart tooltip value incorrect for 2nd y axis
- Chart with Time axis only displaying first grid line and tick label (unitStepSize)
- How to use chart.js to plot line chart with x axis as time stamp in seconds
- Chart.js bar chart with time on X axis and category on Y axis is not rendered
- hereChartJS Line Chart with Time Axis
- ChartJS fails to render one of the lines in cartesian chart following update after change to max Y axis label value
- Multiple axis line chart with Chart.js and JSON data from Google Sheet
- Chartjs line chart gets all scrambled up when an x value coincides with a label
- How to plot a single value with line in line chart graph using charts.js?
- How to set max and min value for Y axis
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- ChartJS New Lines '\n' in X axis Labels or Displaying More Information Around Chart or Tooltip with ChartJS V2
- line chart with {x, y} point data displays only 2 values
- Display line chart with connected dots using chartJS
- Chart.js - line chart with two yAxis: "TypeError: yScale is undefined"
- How to display Line Chart dataset point labels with Chart.js?
- show label in tooltip but not in x axis for chartjs line chart
- Chart.js Mixed Bar and Line chart with different scales
- chart.js Line chart with different background colors for each section
- How do I draw a vertical line on a horizontal bar chart with ChartJS?
- How to display value of only one datapoint in line chart
- Chart.js Dynamically Updating Chart with X Axis Time
- Chart.js - Setting max Y axis value and keeping steps correct
- Chart.js: Line chart with partial dashed line
More Query from same tag
- How do I manipulate a specific tooltip value of a Chart.js pie chart?
- Chart.js not rendering chart with data from mySQL database
- Chart section is empty
- Create PDF with mpdf and chart.js
- My chart is not shown on browser screen using chart.js in meteor
- How to have solid colored bars in angular-chart bar chart
- Using click event handler prevents tooltips from displaying on hover
- update my chartjs form without refreshing page
- Chart js - Line chart - How to hide the data label on the line?
- Chartjs xaxes tick min
- How to have chart.js automatically build x-axis labels based on x,y dataset?
- How can I add new data points to an existing chart with chart.js?
- core.js:4197 ERROR TypeError: chart_js__WEBPACK_IMPORTED_MODULE_2__ is not a constructor
- How to disable event during a state change
- Chart.js not working - Uncaught RefernceError:
- Passing JSON data from PHP array into ChartJS
- Create stacked bar chart with a single dataset per stack
- ChartJS doughnut legend click
- ASP.NET Core Razor Pages - Get List Data to Display on Chart.js Graph
- how to use chart.js in angular 7
- Can't get bar chart colors in Chart js working in React Js
- Chart js shows old data on mouse hover
- How to replay animation chart.js
- Chartjs + jsPDF = Blurry image
- chart.js time scatter with true scale
- Chartjs is stripping trailing zeros in decimal datasets
- Chart.js v3.7.1 Chart is not a Constructor
- How to draw lines between minimum and maximum value to average value in chartJS?
- Chart.js custom plugin before destroy
- ChartJS - legends and tooltips options