javascript - Use Json to Populate Chart with HTML -
i have json file populate barchart through cshtml
.
json file:
[{ "subject": "test app", "appscores": [{ "season": "aaaaaaaaaaaaaaaaaaaa", "year": "1", "value": "44" }, { "season": "bbbbbbbbbbbbbbbbbbbbb", "year": "2", "value": "29" }] }, { "subject": "test app2", "appscores": [{ "season": "ccccccccccc", "year": "3", "value": "15" }, { "season": "ddddddddddddddddd", "year": "4", "value": "32" }] }]
the code within cshtml
file:
<script type="text/javascript"> var mychart = new jschart('chartid', 'bar'); mychart.setdatajson('data2.json'); mychart.draw(); </script>
my data2.json
file located within same directory cshtml file
.
can see missing here?
Comments
Post a Comment