score:0
try to pass function with computed property:
new vue({
el: '#demo',
data() {
return {
options: {
maintainaspectratio: false,
responsive: true,
},
func: ''
}
},
computed: {
getopts() {
this.options.onclick = this.clickhandler
return this.options
}
},
methods: {
clickhandler() {
this.func = 'function passed'
}
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="demo">
<p>{{ options.responsive }}</p>
<p>{{ func }}</p>
<button @click="getopts.onclick">click</button>
</div>
Source: stackoverflow.com
Related Query
- Change chart values from API
- Change the Y-axis values from real numbers to integers in Chart.js
- how to change the Y-axis values from float number to integer in chartjs?
- How to change the Y-axis values from numbers to strings in Chart.js?
- Using data from API with Chart JS
- chart is not getting updated from the values it received from Jquery
- How to make aspecific API call from within a Line Chart class in ReactJS using react-chartjs-2?
- Initialize a Chart.js chart with data from an api
- Is there a convenient way to print values to a JS chart from a CSV file without converting it?
- How to change background color of labels in line chart from chart.js?
- Get Dataset Values from Chart JS onHover in Version 3
- How to fetch all data from API files and assign their values to chart?
- How to get Data from API to display chart using chartjs in Vuejs
- I am using chart.js I sent my time values throw my api as timestamp know i need to show them in the chart as date format
- The chart doesn't display the data from my call to the API with Axios
- How to split data from api to get a chart
- Using number/text input field to set the data values in ChartJs stops the chart from being displayed
- How to stop displaying the data values from different data objects on Chart JS 2.x?
- React Chart.js Match API data to what Title is displaying, then update chart on data/Title change
- How to load new chart (chartsjs) from api call with jquery?
- Change Chartjs financial chart yaxis from left to right
- 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
- Why is the data from my API not displaying on my chart.js chart in React?
- Chart.js Change color of the values *inside* the bars of a Bar chart
- VueJS + Chartjs - Chart only renders after code change
- How to start Y Axis Line at 0 from right for negative values in chart js 2?
- chart does not change the values when the variable changes the value
- getting additional value fields from data source for dx.chartjs doughnut chart
- How to set the data of chart in angular which is taken from the backend nodejs api that is store in mongodb and showing on the html page
- How to take data from an API and create a chart on that using Chart.js and Angular 8?
More Query from same tag
- I have a issue with chart.js, php and infomix database?
- Building Chart.js master - generated .js gives errors
- chart.js modify style from dataset label
- Chart.js v3.x time series on x axis
- ChartJS2 in Ionic2
- customizing tooltip on chart.js bar chart
- Using chartjs v2 to show categorical values on axis instead of numeric
- Angularjs lazy load chartjs when in another tab
- ChartJS horizontal bar with numbers on both scales
- React-Chart-JS-2 ^3.0.5 | TypeError: Cannot read properties of undefined (reading 'visible') at Chart._getSortedDatasetMetas
- Group Bar Chart Dinamic Data Update By Button Fuction ChartJS
- Chart.js Polar Area Chart is not scale right
- Chart.js - Color specific parts of the background in a line chart
- How to access data outside the onclick function
- How to make a line dashed or dotted in chartJS?
- Type can not be assigned in react-chartjs-2
- Chart.js How to make more space between doughnut inside doughnut?
- Changing the label of chart
- chart.js and asynchronous loading
- How to change ChartJS font size with javascript?
- Trouble using utcoffset with Chart.js
- Chartjs-plugin-zoom plugin does not change x axis labels
- Angular chart.js chart scale
- chart.js - line chart - can I visualize positive/negative change somehow?
- Parse a JSON object to ChartJS
- How do I increase the arrow length on the pie chart in Charts.js?
- setInterval on my Doughnut.js
- Using Object.assign to merge objects
- How do I get tool tips to work on 2 data set half doughnut chart?
- Why is ChartJS skipping an xAxis label in this snippet?