I really like CanvasJS and I’m currently using it for a class project for a bit of probability data visualization. I basically have a form with a series of inputs and I’m trying to use the information in the form along with the onsubmitattribute to render a chart upon submitting it. Everything works fine but when it comes to rendering the chart with chart.render, it quickly disappears after a split second. Every time I click the submit button, it displays a chart then it quickly disappears. Could anyone give a reason as to why this is happening?
This topic was modified 4 years, 1 month ago by mbatilando.
After a bit of tinkering, I figured that one of the problem was that I was not using window.onload . But now after I’ve put it, It will not let me update the chart upon clicking the submit button so it’s not displaying any data since there are no inputs in the form directly after the page has loaded.
Chart is not getting rendered because its getting submitted upon click. If you just want to render chart on click of a button, don’t use “form”. Use normal text field and render the chart upon button click.