Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
You could use the following js method to generate charttable's chart:
<script>
myChartTable.generateChart(); // "myChartTable" is ChartTable php widget's name/id
</script>
Of course a label column and some data columns must be selected first for the chart to be generated correctly. You could also set those columns' selected values like this:
$(myChartTable.labelColumnSel).val( [ "myLabelColumn" ] );
$(myChartTable.dataColumnsSel).val( [ "myDataColumn1", "myDataColumn2" ] );
...
myChartTable.generateChart(); // "myChartTable" is ChartTable php widget's name/id
Just put the code in my previous code in your report view file where ChartTable widget is:
ChartTable::create(array(
"name" => "myChartTable",
...
"onReady" => "autoGenerateChart",
));
<script>
function autoGenerateChart() {
$(myChartTable.labelColumnSel).val( [ "myLabelColumn" ] ); // change this to your label column name
$(myChartTable.dataColumnsSel).val( [ "myDataColumn1", "myDataColumn2" ] ); // change these to all of your data column names
myChartTable.generateChart(); // "myChartTable" is ChartTable php widget's name/id
}
</script>
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo