score:16
Accepted answer
This answer will depend on how you are trying to update the information. Assuming you are using exactly as you gave, you will put a timer for every 3 hours and run this function:
function updateWeatherChart(){
WeatherChart.data.datasets[0].data = [1, 2, 3, 4];
WeatherChart.update();
}
You can have something that, like in the documentation says, runs through the data and deletes it first. Or, you can just reassign it with the new information you want to update the existing chart with.
Keep in mind that instead of [1, 2, 3, 4]
you will have to run code before to get the new information and replace the array with your own array. [1, 2, 3, 4]
was just a test case.
Source: stackoverflow.com
Related Query
- Updating chartJS with dynamic data
- Show dynamic data with dynamic colours in chartjs
- Updating Chartjs to 2.5 with custom code
- Angular 6: chartjs value not updating with dynamic value update
- React and Chartjs not updating from dynamic data through api
- Updating Chartjs with new data
- Loading and updating dynamic charts with dynamic data (chart.js)
- ChartJS 3.7 data not dynamically updating with data streaming into CSV
- Updating Chartjs Data with Response from POST Call?
- Unable to get chartjs to draw a chart with dynamic data (variable not hardcoded)
- Chartjs random colors for each part of pie chart with data dynamically from database
- ChartJS - Draw chart with label by month, data by day
- Chartjs - data format for bar chart with multi-level x-axes
- ChartJs line chart - display permanent icon above some data points with text on hover
- ChartJS bar chart fixed width for dynamic data sets
- chart js with angular2 loading dynamic data only after zoomin
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How to create chartjs chart with data from database C#
- Graph streaming real-time data with react and chartjs
- How can I load multiple Chartjs charts with different data on the same page?
- Chartjs not working with d3 from csv source
- ChartJS datasets with one data value
- How can I show JSON data in Chart.js with Javascript if static values are working but dynamic from mySQL are not?
- How to display chart using Chartjs with JSON data in Laravel
- How to create a custom tooltip for chartJS graph with data in JSON array in JavaScript?
- How to plot Firebase data with Chartjs in angular
- chartjs xaxis ticks with round values from shifted input data
- How to reuse a Chartjs Chart component in with different Data and get past the **Canvas is already in use** error?
- Chart isn't updating with Response data (Chart.js 3.2.1, ng2-charts 3.0.0-beta.9)
- chartjs is issue with large amount data
More Query from same tag
- Chartjs, How to edit data option after creating a chart?
- Eror: chart.min.js:13 Uncaught (in promise) Error: Canvas is already in use. Chart with ID '0' must be destroyed before the canvas can be reused
- How to put images/ charts into table?
- ChartsJS Annotations Plugin - Can you create a tooltip to accompany an annotation?
- TypeError: Cannot read property 'legend' of undefined | Angular + ng2-charts
- Changing width and height in angular-chart.js module
- Polar Area onclick event
- Customizing Chart.js troubleshoot
- how to add multiple data in chart js dynamically from JSON
- Show statistics in my diagram (php mysqli)
- Change color of measure unit with Chart.js
- Labels attribute of chartsjs not taking context variable of type string
- char.js overlapping bar columns when using type: 'time'
- Google Pie Chart Is Not Responsive
- Is it possible to add a drop shadow to chart.js line chart?
- angular-charts.js doesnt work with ionic
- How can I effectively adjust the dimensions of a canvas element?
- React ChartJS 2 : Get data on clicking the chart
- Chart.js : straight lines and curves lines in the same graph
- ChartJS x-axis show only months of year
- chartjs loading data from ajax doesn't work fine
- Chartjs 2.0 - Increase height of x-axis labels
- How to allow zooming in between range only in chartjs-plugin-zoom
- How to integrate basic ChartJs customizations when using react-chartjs-2?
- dynamic number of chart.js charts on the same page
- Chart.js not showing line chart. What am I doing wrong?
- how to hide specific dataset based on condition chartjs angular
- Chart.JS using Angular.JS on JSFiddle
- chart js onclick function call
- setInterval on myDoughnut animation