score:0
first off you need to access curent chart
instance. i have fond this github issue, in which author states that current instance is saved in this.$data._chart
.
then you should call getelementsatevent
method of instance, passing an event
as the first argument.
calling
getelementsatevent(event)
on your chart instance passing an argument of anevent
, or jqueryevent
, will return the point elements that are at that the same position of that event. this functionality may be useful for implementing dom based tooltips, or triggering custom behaviour in your application.
this.$data._chart.getelementsatevent(event);
then, implement your custom login, depending on the returned value of that method (if you are using vue router: this.$router.push("/path/to/redirect");
).
Source: stackoverflow.com
Related Query
- Vue ChatJS redirect on pointer click
- VueJs/ChartJs - single file component computed property only renders when I click the component in Vue Dev Tools
- How to run Chart.js samples using source code
- Click events on Pie Charts in Chart.js
- Chart.js: Bar Chart Click Events
- How to add an on click event to my Line chart using Chart.js
- Chart.js how to show cursor pointer for labels & legends in line chart
- Click event on stacked bar chart - ChartJs
- Chart.js & Angular 2 - ng2-charts Custom on Click Event
- using vue-chartjs in vue 3 : createElement is not a function
- Change point color on click using ChartJS
- Changing cursor to pointer on Chart.js bar chart when hover (mousemove) event is disabled?
- How to change the cursor to a pointer when I hover over a bar in a ChartJS bar chart?
- Reactive Vue Chart.js component using Typescript
- how to create multiple chart on one component vue
- Vue Chart.js component does not render
- How to get click event in Chart.js
- Changing data when click button in chart.js
- chart.js - link to other page when click on specific section in chart
- How to change cursor style to pointer on hovering over points of the chart?
- Switch chart.js data with button click
- ChartJS click on bar and change it's background color
- How can I show Bootstrap modal when on click in individual bars in chart.js
- is there a way to call a Component's function from click function of Chartjs
- ChartJS v2: Scale value at click coordinates (time scale)
- Can't apply options of datalabels chartjs plugin in Vue
- How to add ChartJS code in Html2Pdf to view image
- Chart.js click event to open a custom tooltip does not work sometimes
- Chart not rendering w/Chart.js on button click
- Removing chart on click event produces 'removeHoverStyle' of null error
More Query from same tag
- If a radar chart values are full it occupies half the space (Chart.js)
- Create a line chart using an user input table from a data table in chart.js
- Get data from sql database in chartjs using codeigniter
- Chart.js draw mathematical function
- How to Integrate Chart.Funnel.js in Chart.js
- Creating Stacked chart.js graph from array
- Chartjs v2 xAxes label overlap with scaleLabel
- react-chart-js-2 keep bar width no matter what the number of bar is
- JavaScript variable in an object
- Chart.js multiTooltip Labels in Pie
- Dynamically update value for horizontal line in annotation plugin for Chart.js in Angular 5
- Dynamic array javascript
- Why is this bar chart using chart.js not rendering in react.js?
- To display data from mock server into chartjs using ember
- Chart.js vertical line when hovering and shadow on line
- Chart.js - Increase spacing between bottom legend and chart
- chart is not getting updated from the values it received from Jquery
- Passing Global Options to line Chart in 2.1.6/Chart.js
- Angularjs line chart get data from sql
- Dynamic chart codeigniter
- Pie chart isn't loading, but the labels are
- How to externally trigger datalabels-plugin (active) - ChartJS
- ChartJS: Remove padding to the right of chart caused by tick labels
- Chart js size and placement
- ChartJS Draw grid line X-Axis and Y-Axis
- Chart.js chart not displaying until I open the browser's console
- Impossible to render multiple charts with chart.js
- Callback after line chart rendered
- How to align multiple pie charts side by side?
- how do I render PyChart.JS charts in web2py?