我目前正在制作一个交互式图表,该图表应该计算商业项目的潜在风险因素.我一直在使用百度ECharts,并使图表可视化,但无法在数据更改时更新图表.
数据来自外部调查问卷,该调查问卷使用数字单选按钮和复选框来打开和关闭整个设置.
<input type="checkbox" id="GPEbool" value="true"> Example Question 1</h4>
<form action="">
<input type="radio" id="polishedness" value="1"> Idea<br>
<input type="radio" id="polishedness" value="1"> Concept<br>
<input type="radio" id="polishedness" value="2"> Mockup<br>
<input type="radio" id="polishedness" value="5"> Prototype<br>
<input type="radio" id="polishedness" value="7"> Playable<br>
<input type="radio" id="polishedness" value="15"> Polish<br>
<input type="radio" id="polishedness" value="30"> Finished<br>
</form>
Run Code Online (Sandbox Code Playgroud)
现在,问题是将数据导入图表.它获得了最初选择的值(当向其中一个添加"checked"时),但在此之后不会更新.
data: [{ value: $('input[name=polishedness]:checked').val(), name: 'Design'}]
Run Code Online (Sandbox Code Playgroud)
我曾经尝试过每次更改时调用刷新函数,但它将返回刷新不是函数.我真的很茫然,中文文档对我帮助不大:)
有什么建议?提前致谢!