score:2
Accepted answer
you can use jquery:
- add the jquery library
- add a button, i added
<button id="action">action</button>
- add a jquery trigger that executes the 2 lines on click:
$('#action').off().on('click', function() {
mylinechart.options.scales.yaxes[0].ticks.min = -50;
mylinechart.update();
})
Source: stackoverflow.com
Related Query
- Chartjs: update the min and maximum of the yaxes ticks on a click
- ChartJS - Finding the minimum and maximum labels that are inside a pan (When zooming)
- ChartJs - Labelling minimum and maximum value of the Y Axis
- How do I make the Line in ChartJS not exceed the maximum of yAxes
- Ticks for the minimum and maximum values in a Chart.js v2 axis
- Dynamically update the options of a chart in chartjs using Javascript
- ChartJS and jsPDF - why the background is black?
- How to change the color of legend in chartjs and be able to add one more legend?
- ChartJS Line chart cut off at the top and bottom
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- Update charts in chartjs and angular
- ChartJS click on bar and change it's background color
- unable to add background color to the canvas using jspdf and chartjs
- Chartjs v2.5 - only show min and max on scale, absolute positioning on scale
- Points cut at half at the edges of top and bottom, at chartjs
- dynamically update the scale type of chartjs graph
- ChartJS - How to increase the maximum degree of label rotation on x-axis?
- Setting Common labels and background color common for all the charts in ChartJs
- Setting up min and max in chartjs did not work
- zeroLineColor and zeroLineWidth not working for the x-axis in Chartjs
- Is there any way to change the font color and size of labels in Chartjs 3.0.0
- ChartJS automatically scaled chart has undefined min and max
- Why can't I update the aspectRatio within the chartjs chart?
- How to update a chart using VueJS and ChartJS
- Render chartjs and export image to data not in the DOM
- Charts.js scales yaxes ticks min max doesnt work
- How to set the xAxes min and max values of time cartesian chart in Chart.js
- Update the chart data from an array stored in a variable on button click
- Bar chart with min height and zero values - ChartJs
- How to reuse a Chartjs Chart component in with different Data and get past the **Canvas is already in use** error?
More Query from same tag
- How to display value of only one datapoint in line chart
- ChartJS not updating
- add a unit to label with chartjs plugin datalabels
- after div display set to block nothing shows
- Count up values in Chart JS
- Can not update bar chart values in Chart.js 2.0.0 alpha3
- how to change x-axis line style in chartjs?
- How to expand the "Y" scale of the data in chart.js?
- Trying to call API and plot a line chart but it does not show
- Maintain Y axis scale in graph with scroll in the X axis when the dataset grows bigger. Aspect-ratio problem
- ng2-charts How to get the result of multiple push?
- Chart.js - Draw charts with opposite bars - How to set both the y-axis ends to positive number?
- Parse a JSON object to ChartJS
- Emberjs binding properties within Ember object
- Chart.JS - Tooltips - Issue: 3 data points, all three individual tooltips showing for each data point
- How to get rid of the line on top of every point on a line chart (Chart.js)
- Why is ChartJS combining two charts?
- Chart js not working properly in Safari
- Chart.js chart does not display when inside an ngIf.
- Chart.js 3.x custom positioners: cannot use them in TypeScript
- Display Date Label in axes - chart js/ng2 charts
- ChartJS row size
- I want to put my data in chartjs-plugin-streaming
- Chartjs is graphing my values at positions 0,1,2 rather than their values along the x axis
- Usage of ChartJS v3 with TypeScript and Webpack
- Chartjs defaults deprecation warning
- Stacked line chart not displaying correctly when Xaxis is time
- chartjs with the plugin chartjs-plugin-dragdata can i set fix dropdown values
- Assigning data structures to chartjs properties, NOT individually
- Chartjs annotations-plugin: Can I add multiple vertical lines to identically named x-axis labels?