Class Report Widget

Class constructor

new Report([
	String id,
	String class = 'sg-drawreport',

	String queryUrl = '',
	String dataType = 'json',
	String graphType = 'Bar',
	String submitIcon,
	String submitText,
	Array filterBar,
	Bool $showArrowLeft;
	Bool $showArrowRight;
	String $filterPretext;
	Bool $showPage = false;
	Array $input = [];
	Array optionBar = [],
	Array filter = [],
	Array output = [],
]);

Property :

// For dropdown filter
filterBar ↔ [
	'title' : String
	'child' : [
		String or Widget,
		...
	]
	'children': Array of child
]

// For bar filter
filter ↔ [
	String,
	'key' => [
		'group' => 'Group Text', // If set, can click to show group report
		'type' => 'radio', // Radio, checkbox
		'text' => 'Select Text',
		'filter' => 'variable name',
		'class' => 'class',
		'select' =>[
			'choice 1' => 'Value 1',
			'choice 2' => 'Value 2',
			'choice 3' => 'Value 3',
			'choice sub' => [
				'label' => 'Other',
				'items' => [
					'choice 4' => 'Value 4',
					'choice 5' => 'Value 5',
					'choice 6' => 'Value 6',
				],
		],
	],
	Widget,
	...
]
optionBar ↔ [
	String or Widget,
	...
]
output ↔ [
	key => String value,
	...
]
editMode ↔ Boolean
action ↔ String

Method :

Report::build() → String
Report::filter($key, $value)
Report::output($key, $html = NULL)