<?php

/**
 * Class SG_Report_Date
 */
abstract class SG_Report {

	/**
	 * @var string|void
	 */
	protected $title = '';

	protected $data = null;

	/**
	 * Chart Type.
	 * @var string
	 */
	protected $type = 'bar';

	/**
	 * @var bool
	 */
	protected $show_legend = 0;

	/**
	 * Return the Chart Type.
	 *
	 * @return string
	 */
	public function show_legend() {
		return $this->show_legend;
	}

	/**
	 * Return the Chart Type.
	 *
	 * @return string
	 */
	public function get_type() {
		return $this->type;
	}

	/**
	 * Get the Title;
	 * @return string
	 */
	public function get_title() {
		return $this->title;
	}

	/**
	 * Set the data.
	 * @param $data
	 */
	public function set_data( $data ) {
		$this->data = $data;
	}

	/**
	 * Report Options.
	 * @return string
	 */
	public function get_report_options() {
		return '';
	}

	/**
	 * Get labels for JavaScript.
	 *
	 * @return string
	 */
	public function get_labels() {
		$data = $this->get_data();
		return "'" . implode( "','", array_keys( $data ) ) . "'";
	}

	/**
	 * Get data sets.
	 *
	 * @return array
	 */
	public function get_data_sets() {
		return array();
	}

	/**
	 * Get Data
	 */
	public function get_data() {
		return $this->data;
	}

	/**
	 * Get the report View
	 */
	public function get_view() {
		?>
		<canvas id="sgReportChart"></canvas>
		<?php
	}

}