score:0
Accepted answer
You can use window.location.replace()
to redirect to another page, and pass the parameters in a query string, like so:
onClick: function(c,chart_instances){
try{
ev = chart_instances[0];
window.location.replace("./yourNextPage?label=" + this.data.labels[ev._index] + "&value=" + this.data.datasets.data[ev._index]);
} catch (e){
//ignore misclicks
}
}
Refer to this question on instructions to retrieve the data from a query string in your next page.
Source: stackoverflow.com
Related Query
- How can i get the Chart JS Bar Graph Bar Label and Value on click?
- How can I get my Chart.JS bar chart to stack two data values together on each bar, and print a calculated value on each bar?
- How can I reduce the spacing between my legend and chart proper in my Chart.JS bar chart, and increase it in the graph area?
- How to show symbols after the label and before the numeric value using chart.js Bar chart in Angular
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- Remove the label and show only value in tooltips of a bar chart
- How can I get the active label element on click in ChartJS?
- How to access or get value of specific graph on chart plot by click event?
- Click on interactive chart.js bar chart and get value for labels and groups in JS
- how can i show labels and value in both on bar chart
- How can I calculate a value and place it inside the last bar in a Chart.JS bar chart?
- how I can get label name when user click on particular area in doughnut chart.js? I am not able to find the index of selected area for chart.js
- How can i launch a modal after clicking each bar in Bar chart in Chartjs and also how can i get its data?
- How to get a value from function javascript and print it to the chart
- Chart.js - mixing bar and line graphs - can I get the lines to fill the full column?
- Chart js: how can I align the legend and the title
- PrimeNg bar chart how to show a label for the y-axis
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- How to get the actual chart width and height in chart.js
- How can I datalabels and Sum display in the same time on a stacked bar
- How to change the label and grid line position on a timeseries chart in Chart.js 3?
- How do I customize y-axis labels and randomly pick the value from the data range for x-axis in Chart js
- How can I have different values for the chart and the tooltip in chart.js?
- How to set the chartjs bar graph scale to the highest value in the result data
- how can i use chart.js to create a chart that has one time series line and one linear line on it at the same time?
- How can I append a calculated value to the end of a bar in Chart.JS?
- How to reuse a Chartjs Chart component in with different Data and get past the **Canvas is already in use** error?
- how can i add value on bar in the charts in chart.js vs 3.x
- how to pass the value of input to my bar chart
- How can I fasten up the Chart.js graph generation from JQuery over PHP and mySQL?
More Query from same tag
- Want to save chart.js charts to image using django cron job
- How to populate a charts.js pie chart using json array
- Options: plugins not functioning
- How to hide y axis line in ChartJs?
- How to create a chart with chartjs.org with data from an array?
- Reducing Y-axis in chart.js
- chartjs line graph destroy function is not clearing the old chart instances
- ChartJS xAxis time formats don't change for days
- how to transform changing data to be visualized in a chart.js
- Chart.js not to be begin in Y-Axis
- functional component not re-rendering after setState update hook
- d3.csv parseFloat will not parse correctly
- How to pass variable (list) to JavaScript in Django?
- Chart JS pass in custom data for points
- Javascript - Create objects to push in array
- chart.js remove on hover effect
- Vue-Chartjs reactive chart options passing
- ChartJS: Show default tooltip onclick
- Displaying the first value of the array in datasets.label Chartjs
- Change label color over a specific value in Chart.js
- Chart.elements.Rectangle.prototype.draw inpacting on other charts in the same page(Angular)
- ChartJS - Gradient color overlap
- Overlay Line on chart.js Graph
- Why using logarithmic gives 8e+2 value?
- (ng2-charts, angular) Doughnut chart not showing up after AOT? (but filltext is working)
- custom tooltip opacity always 1
- Display a single tooltip with Chart.JS?
- Object.values not seperated by parentheses / Chartjs only displays first element of array
- Radarwidth beyond label chart.js
- chart.js load totally new data