score:3
The click
attribute on the canvas element is expecting a callback. In your code, you put the result of the function onClick
as a callback (undefined), not the function itself. So basically, you can remove the paranthesis in your code :
<canvas id="line" class="chart chart-line chart-xl" data="data" labels="labels" legend="true" click="onClick" series="series"></canvas>
Hope this helps,
Cheers
Source: stackoverflow.com
Related Query
- Click event using Chart.js with AngularJS
- How to add an on click event to my Line chart using Chart.js
- Display line chart with connected dots using chartJS
- Click event on stacked bar chart - ChartJs
- Using data from API with Chart JS
- Removing chart on click event produces 'removeHoverStyle' of null error
- Click event of stacked line chart not working
- Stacked bar chart with rounded corner of bar using Chart.js
- Chart.js click on labels, using bar chart
- Using chart js options with react-chartjs-2 and typescript
- Chart Click Event - Clicking label of doughnut chart, doesn't return label ng2-charts
- Implementing a choropleth chart using chartjs-chart-geo plugin with react-chartjs-2
- How to display chart using Chartjs with JSON data in Laravel
- How to make dynamic chart using Vue component with chart-js
- Chart.js and Angular - Click Event on Chart
- On click event to show name of pie chart slice in chartsJS
- Line Chart using Chart js with time data
- Chart Js Line chart with fill on click with full information of its legend text
- Real-time line chart with ChartJS using Ajax data
- Chart js with problems when using too many series
- How to add text inside the doughnut chart using Chart.js AngularJS 2.0?
- what is wrong with my code ? java script chart position
- How do you create a Radar chart using chart.js with a y-axis of 0 to 100?
- Time chart labels with some X axis labels using Chart js v3
- Remove redundant legends on the chart using generateLabels with ChartJS v3
- How to export Chart.js chart using toBase64Image, but with no transparency?
- Creating mixed Bar Chart with ReactJS using recharts or react-chartjs-2
- I need to increase data in a bar chart by one with a button click
- How to compute x,y values from a click event using x,y pixel coordinates in ChartJS?
- Can't use a chart module with angularjs
More Query from same tag
- Some imports are missing in ng2-charts@3.0.8
- How to change position of label of y-axes in chartjs?
- Php/ajax return JSON in same form as javascript array
- Manually display tooltip Chart.js
- Dynamic maximum y-axis value on Chart.js
- Chart.js and Angular 8 - Dynamically updating Chart.js labels and data from *ngfor
- Chart.js, set a max value
- Set different color for each bars using ChartJS in Angular 4
- MongoDB based data is not populating in Chart.js
- how to filter year from datefield in django
- Chartjs-node with canvas-prebuilt is still throwing 'Cairo not found' errors
- hiding x-axes labels with 0 values on a bar chart
- X-axis multiple colored label for bar chart using chart.js
- Disable display of x and y values on ChartJS
- Changing the label of chart
- Two charts using same options, but I need different titles for the charts
- Change Legend Box Outline Chart.js 2
- Center point labels between ticks (Polar Area Chart JS)
- ChatJS 2.8.0 min/max axis issue and labels on the top
- Chart.js label value
- Angular 9 chartJs is not updating view after data update
- Updating Chart Data on Charts.js with Ng2-Charts
- react-chartjs-2 bar touches the top
- Angular Chart.js, how to remove series?
- Chart not rendering w/Chart.js on button click
- Modifying values in a radar chart.js based on user input
- Vue-chartjs not rendering chart until page resize
- how to make realtime update chart like in package express-status-monitor?
- How to set a full length background color for each bar in chartjs bar
- generate multiple charts via loop for chart js