score:0
try a 'change' event on each of the selects which loads the appropriate data for the selected option, removes the existing data from the dataset and pushes the new data onto the dataset.
$('.team-one').change(function () {
var sel = $(this).val();
var newdata = [];
switch(sel) {
case 'person two':
newdata = ['insert data for person two'];
mychart.datasets[0].data.length = 0;
mychart.datasets[0].data.push.apply(
mychart.datasets[0].data, newdata);
break;
case 'individual three':
//structure as above with data for individual three
break;
case 'person four':
//structure as above with data for person four
break;
default:
//structure as above with data for sample one
}
mychart.update();
});
Source: stackoverflow.com
Related Query
- ChartJS changing displayed data based on dropdown selection
- ChartJS changing displayed data based on date?
- ChartJS changing graphs based upon Drop Down selection
- ChartJS have xAxes labels match data source
- Using number/text input field to set the data values in ChartJs stops the chart from being displayed
- ChartJS vertical bar chart - measure percentage of the data in each column based on a specified max
- Calling data from outside of Chartjs code
- Is it possible to make ChartJS X-Axis an automatic day based on data and formatted to month?
- ChartJS Tooltip - Change Data Format Displayed
- Chartjs Bar Chart showing old data when hovering
- ChartJS - Different color per data point
- Chartjs random colors for each part of pie chart with data dynamically from database
- ChartJS - Draw chart with label by month, data by day
- Displaying JSON data in Chartjs
- Chartjs v2 - format tooltip for multiple data sets (bar and line)
- Changing fontFamily on ChartJS bar chart
- Chartjs hide data point labels
- Hide Y-axis labels when data is not displayed in Chart.js
- Updating chartJS with dynamic data
- ChartJS show gaps in time data
- Chartjs 2 scaling lots of data points
- dump missing date in data for chartjs
- ChartJs canvas showing previous graph when changing Graph types
- ng2-charts customize data and whole html content of tooltip displayed when hovering on bar chart
- Show data dynamically in line chart - ChartJS
- React ChartJS prevent new data from being added into state after it's redrawn?
- Chartjs - data format for bar chart with multi-level x-axes
- How to show data values or index labels in ChartJs (Latest Version)
- How to feed hour and minute data into chartJS
- ChartJS bar not showing up for simple data points
More Query from same tag
- How to add legend on chart js annotation
- Chart JS Error : Uncaught TypeError: Cannot read property 'top' of undefined
- chartjs Asp.net MVC Remote Data
- Chart JS Crosshair - Linked Charts without linked Legends
- Changing Chart.js chart type doesn't remove older axis
- Chart.js change legend toggle behaviour
- Chart.js: How to group legends of dataset? So one toggle for multiple datasets?
- Chartjs 3 ToolTip styling is not being picked up
- tooltip messes up bar chart in Chart.js
- ChartJS is slow
- Reactive Vue Chart.js component using Typescript
- Adding custom title in tooltips of chart.js
- ChartJs create Chart from array
- Adding a Label to Chart js Pie Graph
- Remove custom Chart Js tool tip colour square
- How to use a string returned from php by ajax as data for a chart.js chart?
- ChartJS, add new dataset
- Fit outlabels to canvas and use different colors chartjs
- Combine multiple columns values to one label in chart.js
- Why do literal arrays work, but not coded arrays?
- ChartJS Separate Labels for each dataset/independent datasets?
- Chart.js: Line chart with partial dashed line
- Chart.js Passing an array starting with 1 instead of 0 problem
- Image-Chart ChartJs Ticks Callback not Working?
- How to position chart details next to a chart responsive for multiple devices?
- Highlight external element on ChartJS hover
- Chart.js: Fill background between two lines
- Print pie chart in chartjs
- EJS Tags with ChartJS?
- charts.js stacked y-Axis