score:0
your mistake is the following
to update the options, mutating the options property in place or passing in a new options object are supported.
from chart.js
for the update to work, you need to mutate the original object, which you are not doing.
just fix it by doing this
function generatechart() {
generatelabels();
chart.data.labels = generatelabels();
chart.update();
}
or better, create/show the chart only when you click generate.
Source: stackoverflow.com
Related Query
- how to change Y axis value dynamically based on user input in Chartjs for Line chart?
- Chart.js - Setting x-axis based on user input
- Modifying values in a radar chart.js based on user input
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Create a line chart using an user input table from a data table in chart.js
- React - render Chart.js chart based on user selection, after Ajax returns JSON
- In Chart.js set chart title, name of x axis and y axis?
- ChartJS New Lines '\n' in X axis Labels or Displaying More Information Around Chart or Tooltip with ChartJS V2
- Chart Js change text label orientation on Ox axis
- Chartjs 2 - Stacked bar and unstacked line on same chart with same y axis
- show label in tooltip but not in x axis for chartjs line chart
- Chart.js setting maximum bar size of bar chart
- Chart JS - set start of week for x axis time series
- Show X axis on top and bottom in line chart rendered with Chart.js 2.4.0
- Chart.js Dynamically Updating Chart with X Axis Time
- Chart.js - Setting max Y axis value and keeping steps correct
- How do I change the 'months' language displayed on the date axis in Chart JS?
- Obtain max value of y axis of line chart rendered with Chart.js
- Changing x axis labels in Chart.js line chart
- Line chart with large number of labels on X axis
- chart.js switch x/y axis on line chart
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- Chart js different background for y axis
- Map event position to y axis value in chartjs line chart
- Show all values in Chart js y axis
- Chart Js, Style some ticks on the axis differently
- How to start the line graph from the left Y axis in a line/bar mixed chart (Chart.js)?
- How to dynamically set ChartJs line chart width based on dataset size?
- chart.js bar chart color change based on value
- Hovering over chart.js values in Meteor onRendered function causes chart axis shift
More Query from same tag
- Chart.js stepSize not working with min
- How to append text or symbol to tooltip of chart.js
- What is the correct way to send 2 parameters in socket.io using lambdas? (I get undefined when printing in client and server)
- Set animation dynamically in Chart.JS
- How to address type errors when removing data with chart.js?
- Chart.js update() method only works once in the end instead of updating every iteration
- chartjs stepSize by 5
- How do I set a bar chart to default to a suggested maximum in chart.js v1.01?
- Add Gridlines using ChartKick in Rails
- Chart.js line chart not showing in Google Chrome canvas(only in Microsoft Edge)
- charts.js update global variables
- Defining y-starting point for floating horizontal bar charts in Chart.js?
- How to make custom text appear underneath each bar in chartjs bar chart?
- Chart.js: Pie chart legend "onclick" gets overwritten by "options.onclick" if both are present
- How to pass dynamic string as dataset in charts.js
- Adding images/icons to specific coordinates in chart.js
- Chart.JS: How can I only display data labels when the doughnut size is big enough for the text?
- chartjs-plugin-annotations not displayed in primeNG chart
- Chart.js Doughnut Chart Rendering Wrong
- Artefacts when showing compact vertical bar chart in chart.js
- Chart.js Using A JavaScript Object
- how to use chart.js in webpacker rails 6
- ChartJS: Full Date for xAxis Labels?
- Chart.js pie chart in table shows weird behavior on page resize
- Vue ChartKick - different colours for bar chart
- Using loops to create data arrays
- ChartJS - How to choose the visible datalabels
- Setting Chart.js Pie-Graph Options
- Is it able to align line chart at left margin in mixed chart?
- Pass custom labels as an array to Chart JS Tool tip