Jump to content

Stats $chart help


TheJackal84

Recommended Posts

I have a couple of questions on the $chart feature

  1. How do I set the default view? anytime I try it is always on the AreaChart view, even if I remove it from the $chart->availableTypes
  2. If I put it to show in the front end then when I change the view it always gives a url with &type[e7e453]=BarChart&noheader=1 and it takes away the date filter and the view filters, if i remove the no from noheader it's all there, Although in the admin panel it all works fine
Link to comment
Share on other sites

	/**
	 * Constructor
	 *
	 * @param	\IPS\Http\Url	$url			The URL the chart will be displayed on
	 * @param	string			$table			Database Table
	 * @param	string			$dateField		Database column that contains date
	 * @param	string			$title			Title
	 * @param	array			$options		Options
	 * @param	string			$defaultType	The default chart type
	 * @param	string			$defaultTimescale	The default timescale to use
	 * @param	array			$defaultTimes	The default start/end times to use
	 * @param	array 			$tableInclude	Table columns to include in results
	 * @param	string			$identifier		If there will be more than one chart per page, provide a unique identifier
	 * @param	\IPS\DateTime|NULL	$minimumDate	The earliest available date for this chart
	 * @see		<a href='https://google-developers.appspot.com/chart/interactive/docs/gallery'>Charts Gallery - Google Charts - Google Developers</a>
	 * @return	void
	 */
	public function __construct( \IPS\Http\Url $url, $table, $dateField, $title='', $options=array(), $defaultType='AreaChart', $defaultTimescale='monthly', $defaultTimes=array( 'start' => 0, 'end' => 0 ), $tableInclude=array(), $identifier='', $minimumDate=NULL )

I assume you are using a dynamic chart (e.g. \IPS\Helpers\Chart\Database), and if so you would pass the default view as the 6th parameter to the constructor. See applications/core/modules/admin/activitystats/keywords.php as an example that uses a LineChart by default.

Link to comment
Share on other sites

40 minutes ago, bfarber said:

I assume you are using a dynamic chart (e.g. \IPS\Helpers\Chart\Database), and if so you would pass the default view as the 6th parameter to the constructor. See applications/core/modules/admin/activitystats/keywords.php as an example that uses a LineChart by default.

Perfect thanks, works like a charm

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...