java - Am trying to get chartin web page according to the graph value. but -



java - Am trying to get chartin web page according to the graph value. but -

<script type="text/javascript"> $(document).ready(function (){ myfunc(); }); function myfunc(){ if (document.getelementbyid('graph').value=10){ var chartdata = [{"category":"payment details", "value1":10, "value2":90}]; var chart = amcharts.makechart("chartdiv", { "theme": "light", "type": "serial", "depth3d":100, "angle":30, "automargins":false, "marginbottom":100, "marginleft":350, "marginright":300, "pathtoimages": "images/", "dataprovider": chartdata, "valueaxes": [{ "stacktype": "100%", "gridalpha": 0 }], "graphs": [{ "type":"column", "topradius":1, "columnwidth":1, "showonaxis":true, "linethickness": 2, "linealpha": 0.5, "linecolor": "#ffffff", "fillcolors": "#8d003b", "fillalphas": 0.8, "valuefield": "value1" },{ "type":"column", "topradius":1, "columnwidth":1, "showonaxis":true, "linethickness": 2, "linealpha": 0.5, "linecolor": "#cdcdcd", "fillcolors": "#cdcdcd", "fillalphas": 0.5, "valuefield": "value2" }], "categoryfield": "category", "categoryaxis": { "axisalpha": 0, "labeloffset":40, "gridalpha":0 } });} else if (document.getelementbyid('graph').value=20){ var chartdata = [{"category":"payment details", "value1":20, "value2":80}]; var chart = amcharts.makechart("chartdiv", { "theme": "light", "type": "serial", "depth3d":100, "angle":30, "automargins":false, "marginbottom":100, "marginleft":350, "marginright":300, "pathtoimages": "images/", "dataprovider": chartdata, "valueaxes": [{ "stacktype": "100%", "gridalpha": 0 }], "graphs": [{ "type":"column", "topradius":1, "columnwidth":1, "showonaxis":true, "linethickness": 2, "linealpha": 0.5, "linecolor": "#ffffff", "fillcolors": "#8d003b", "fillalphas": 0.8, "valuefield": "value1" },{ "type":"column", "topradius":1, "columnwidth":1, "showonaxis":true, "linethickness": 2, "linealpha": 0.5, "linecolor": "#cdcdcd", "fillcolors": "#cdcdcd", "fillalphas": 0.5, "valuefield": "value2" }], "categoryfield": "category", "categoryaxis": { "axisalpha": 0, "labeloffset":40, "gridalpha":0 } }); } </script> <form:form method="get" modelattribute="xyz" action="xyz.htm" > <c:foreach items="${payouts}" var="payout" > <tr> <input type="hidden" name="graph" id = "graph" value ="${payout.graph}"/> </tr>

am trying cylindrical chart in jsp using graph value. chart not displaying value=20. if case executing graph value 20

please suggest how chart in jsp on th basis of graph value

i had used below statement. , worked fine me.

if (document.getelementbyid('graph').value==10){....}

java javascript html jsp spring-mvc

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -