var options_{{ code }}_chart = { animationEnabled: true, exportEnabled: true, title:{ text: "{{ title }}" }, axisY: { title: "{{ y_axis_title }}", valueFormatString: "{{ y_axis_format }}", suffix: "{{ y_axis_suffix }}", preix: "{{ y_axis_preix }}", {{ y_axis_extra_options }} }, axisX: { title: "{{ x_axis_title }}", valueFormatString: "{{ x_axis_format }}", suffix: "{{ x_axis_suffix }}", preix: "{{ x_axis_preix }}", {{ x_axis_extra_options }} }, data: [ { yValueFormatString: "{{ y_data_format }}", xValueFormatString: "{{ x_data_format }}", type: "spline", } ] } $.get("{{ data_url }}"). then((response) => { options_{{ code }}_chart.data[0].dataPoints = response; var {{ code }}_chart = new CanvasJS.Chart( "{{ code }}", options_{{ code }}_chart ); {{ code }}_chart.render(); });