How to setup chart in eform
Good day.
I'm trying to display data on a chart on the form. I need the chart to change as the data is collected (Line graph).
I have it so that the time and the recorded hardness value are each recorded in their own text area. The time should be on the x-axis and the hardness value should appear on the y-axis above the respective time.
Can this be done with the active data and by not needing to save the data to a database, i.e. so that the information is only applicable as long as the program runs?
Thanks for any help.
-
Hi ,
Please follow below steps to achieve desired results.1. Drag and drop two text area controls onto the form.
2. Add a chart control.
3. In the Custom JavaScript Snippet section, add the following code:function loadChart(){
var chart = $("#Chart1").data("kendoChart");
var txt3 = $('#TextArea3').val().split('\n');
var txt2 = $('#TextArea2').val().split('\n');
chart.setOptions({series : [{data : txt3}]});
chart.setOptions({ categoryAxis: {'categories' :txt2}});
chart.setOptions({tooltip: { visible: true, template: "#: category # - #: value #"}});
chart.redraw();
}4. Add a button control, and call this function when the button is clicked.
Regards
Dhanush BV
Please sign in to leave a comment.
Comments
4 comments