javascript - How to put dynamic value in Doughnutchart Using chartjs? -


I'm starting at the chart, I need a dynamic price update using the Form Table Submit button.

(chartjs)

I chart. Min.js

  & lt; I am using form & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; P & gt; & Lt; Label & gt; mobilizations & lt; / Labels & gt; & Lt; Input type = 'text' id = "donut-1" /> & Lt; / P & gt; & Lt; / li & gt; & Lt; Li & gt; & Lt; P & gt; & Lt; Label & gt; Blue print & lt; / Label & gt; & Lt; Input type = 'text' id = "donut-2" /> & Lt; / P & gt; & Lt; / li & gt; & Lt; Li & gt; & Lt; P & gt; & Lt; Label & gt; Realization & lt; / Labels & gt; & Lt; Input type = 'text' id = "donut -3" /> & Lt; / P & gt; & Lt; / li & gt; & Lt; Li & gt; & Lt; P & gt; & Lt; Label & gt; Final preparation & lt; / Labels & gt; & Lt; Input type = 'text' id = "donut-4" /> & Lt; / P & gt; & Lt; / li & gt; & Lt; Li & gt; & Lt; P & gt; & Lt; Label & gt; Goliv & amp; Support & lt; / Labels & gt; & Lt; Input type = 'text' id = "donut-5" /> & Lt; / P & gt; & Lt; / li & gt; & Lt; Li & gt; & Lt; Input type = "button" id = "submit-1" value = "submit" /> & Lt; / li & gt; & Lt; / Ul & gt; & Lt; / Form & gt; Var: DoughnutData = [label: "Mobilizations", Value: 60, Color: "# 165c91"}, {Label: "Blue Print", Value: 60, Color: "# 0070c0"}, {label: "Reality" Value: 60, color: "# 157cc0"}, {label: "final preparation", value: 60, color: "# 0d74be"}, {label: "Goliv and support", value: 60, color: "# 0a5184 "},]; Var Doshanut option = {Segment show stroke: false, animatecakel: true} // donut chart canvas work donut = document. Get Element BIID ("Donut"). GetContext ("2D"); // Attract new charts of donut chart (donut). Donnat (Donantatata, Dolonut option);   

I am starting JS & amp; Js Using the form table, I have to change the fixed value to Dynamic. If we add value to the table & amp; Submit the chart will change.

(chart)

I am using chart.min.js

Well, first you should read, but depending on your question I'm assuming that you do not understand English well.

The method you are looking for is .addData (Segment Data, Index)

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -