jsreport chart using sample data
-
How can I access a sample data (under data node) in a script tag on report template to build the chart axis and data.
In the below example I want to read the data form sample data.report link: https://playground.jsreport.net/studio/workspace/g1U3De6Ch/1
<script>
$(function () {var d1 = [];
for (var i = 0; i < 14; i += 0.5) {
d1.push([i, Math.sin(i)]);
}$.plot("#placeholder", [d1]);
});
</script>
-
updated example to read a value from sample data -> https://playground.jsreport.net/studio/workspace/g1U3De6Ch/172
-
FYI The approach is further explained also in this blog post
https://jsreport.net/blog/using-input-data-in-html-page-inline-javascript
-
Thank you for prompt reply, that's perfectly worked for me.