function generateAnalytics() { require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRoller.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerSeriesData.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerLineChart.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerColumnChart.php'; $validGroupType = JAnalytics::getGroupType(); $analyticsGroupBy = JRequest::getVar('group_type', 'day'); $analyticsGroupBy = !in_array($analyticsGroupBy, $validGroupType) ? 'day' : $analyticsGroupBy; $linechart = new HighRollerLineChart(); $linechart->chart->renderTo = 'dashboard'; $linechart->chart->type = 'area'; //$linechart->tooltip->enabled = false; $linechart->yAxis = new StdClass(); $linechart->xAxis = new StdClass(); $linechart->yAxis->title = new StdClass(); $linechart->yAxis->title->text = ''; $linechart->yAxis->min = 0; $linechart->yAxis->labels = new StdClass(); $linechart->xAxis->labels = new StdClass(); $linechart->yAxis->labels->enabled = true; $linechart->xAxis->labels->enabled = true; $linechart->xAxis->categories = JAnalytics::getXAxisCategory($analyticsGroupBy); $linechart->legend = new StdClass(); $linechart->credits = new StdClass(); $linechart->legend->enabled = false; $linechart->credits->enabled = false; //$linechart->title->text = 'Line Chart'; // Get the filter for log, default is all activities $filter = JRequest::getVar('filter', '0'); if ($filter == '0') { $chartData1 = JAnalytics::get('', null, null, '', $analyticsGroupBy); $series1 = new HighRollerSeriesData(); $series1->addName(JText::_('COM_ANALYTICS_LABEL_ACTIVITY'))->addData($chartData1)->addColor('#41A317'); $linechart->addSeries($series1); } $chartData2 = JAnalytics::get(array('message.add'), null, null, '', $analyticsGroupBy); $series2 = new HighRollerSeriesData(); $series2->addName(JText::_('COM_ANALYTICS_LABEL_NEW_POST'))->addData($chartData2)->addColor('#64E986'); $linechart->addSeries($series2); $html = '<div id="dashboard"></div><script type="text/javascript">' . $linechart->renderChart() . '</script>'; return $html; }
require_once '_assets/HighRoller/HighRollerLineChart.php'; // HighRoller: sample data for customized HighRoller Multi-series Line Chart for ($i = 0; $i <= 50; $i++) { $chartData[0][] = rand(4000, 8000); $chartData[1][] = rand(5000, 15000); $chartData[2][] = rand(250, 4000); $categories[$i] = 'Label-' . $i; } // HighRoller: create multiple Series Data objects and add name, color and data to each $series1 = new HighRollerSeriesData(); $series1->addName('Finance')->addColor('#ff9900')->addData($chartData[0]); $series2 = new HighRollerSeriesData(); $series2->addName('Google')->addColor('#0099ff')->addData($chartData[1]); $series3 = new HighRollerSeriesData(); $series3->addName('Apple')->addColor('#00cc00')->addData($chartData[2]); $linechart = new HighRollerLineChart(); $linechart->title->text = "Most Popular Topics"; $linechart->title->align = "left"; $linechart->title->floating = true; $linechart->title->style->font = '18px Metrophobic, Arial, sans-serif'; $linechart->title->style->color = '#0099ff'; $linechart->title->x = 20; $linechart->title->y = 20; $linechart->chart->renderTo = 'linechart'; $linechart->chart->width = 900; $linechart->chart->height = 300; $linechart->chart->marginTop = 60; $linechart->chart->marginLeft = 90; $linechart->chart->marginRight = 30; $linechart->chart->marginBottom = 110; $linechart->chart->spacingRight = 10;
* * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // HighRoller: include class files require_once '_assets/HighRoller/HighRoller.php'; require_once '_assets/HighRoller/HighRollerSeriesData.php'; require_once '_assets/HighRoller/HighRollerLineChart.php'; // HighRoller: sample data $chartData = array(5324, 7534, 6234, 7234, 8251, 10324); // HighRoller: create a new line chart object and modify some basic properties $linechart = new HighRollerLineChart(); $linechart->chart->renderTo = 'linechart'; $linechart->title->text = 'Line Chart'; $linechart->yAxis->title->text = 'Total'; // HighRoller: create new series data object and hydrate with precious data $series1 = new HighRollerSeriesData(); $series1->addName('myData')->addData($chartData); // HighRoller: add series data object to chart object $linechart->addSeries($series1); ?> <head> <!-- jQuery 1.6.1 --> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
require_once '_assets/HighRoller/HighRoller.php'; require_once '_assets/HighRoller/HighRollerSeriesData.php'; require_once '_assets/HighRoller/HighRollerLineChart.php'; // HighRoller: Line chart sample data $chartData = array(5324, 7534, 6234, 7234, 8251, 10324); // HighRoller: create and modify Line chart $linechart = new HighRollerLineChart(); $linechart->chart->renderTo = 'linechart'; $linechart->title->text = 'jQuery Line Chart'; // HighRoller: create and add Series 1 data $series1 = new HighRollerSeriesData(); $series1->addName('myData')->addData($chartData); // HighRoller: add series data to chart $linechart->addSeries($series1); // HighRoller: create and modify Line chart $linechart2 = new HighRollerLineChart(); $linechart2->chart->renderTo = 'linechart2'; $linechart2->title->text = 'MooTools Line Chart'; // HighRoller: create and add Series 1 data $series1 = new HighRollerSeriesData(); $series1->addName('myData')->addData($chartData); // HighRoller: add series data to chart $linechart2->addSeries($series1); ?> <head> <title>HighRoller | Smoke Test</title> <link href='http://fonts.googleapis.com/css?family=Open+Sans&v1' rel='stylesheet' type='text/css'> <link href='_assets/jquery.snippet.css' rel='stylesheet' type='text/css'> <link href='_assets/highroller.css' rel='stylesheet' type='text/css'>
require_once '_assets/HighRoller/HighRoller.php'; require_once '_assets/HighRoller/HighRollerSeriesData.php'; require_once '_assets/HighRoller/HighRollerLineChart.php'; // HighRoller: Line chart sample data $chartData = array(5324, 7534, 6234, 7234, 8251, 10324); // HighRoller: create and modify Line chart $linechart = new HighRollerLineChart(); $linechart->chart->renderTo = 'linechart'; $linechart->title->text = 'jQuery Line Chart'; // HighRoller: create and add Series 1 data $series1 = new HighRollerSeriesData(); $series1->addName('myData')->addData($chartData); // HighRoller: add series data to chart $linechart->addSeries($series1); // HighRoller: create and modify Line chart $linechart2 = new HighRollerLineChart(); $linechart2->chart->renderTo = 'linechart2'; $linechart2->title->text = 'MooTools Line Chart'; // HighRoller: create and add Series 1 data $series1 = new HighRollerSeriesData(); $series1->addName('myData')->addData($chartData); // HighRoller: add series data to chart $linechart2->addSeries($series1); ?> <head> <title>HighRoller | Build How To</title> <link href='http://fonts.googleapis.com/css?family=Open+Sans&v1' rel='stylesheet' type='text/css'> <link href='_assets/jquery.snippet.css' rel='stylesheet' type='text/css'> <link href='_assets/highroller.css' rel='stylesheet' type='text/css'>
public function generateAnalytics($user) { require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRoller.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerSeriesData.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerLineChart.php'; require_once JPATH_ROOT . DS . 'libraries/HighRoller/HighRollerColumnChart.php'; $validGroupType = JAnalytics::getGroupType(); $analyticsGroupBy = JRequest::getVar('group_type', 'day'); $analyticsGroupBy = !in_array($analyticsGroupBy, $validGroupType) ? 'day' : $analyticsGroupBy; $chartData1 = JAnalytics::get('', $user->id, null, '', $analyticsGroupBy); $chartData2 = JAnalytics::get(array('message.like', 'comment.like'), $user->id, null, '', $analyticsGroupBy); $linechart = new HighRollerLineChart(); $linechart->legend = new stdClass(); $linechart->credits = new stdClass(); $linechart->chart->renderTo = 'linechart'; $linechart->chart->type = 'area'; $linechart->yAxis = new stdClass(); $linechart->yAxis->title = new stdClass(); $linechart->yAxis->labels = new stdClass(); $linechart->xAxis = new stdClass(); $linechart->xAxis->title = new stdClass(); $linechart->xAxis->labels = new stdClass(); $linechart->yAxis->title->text = ''; $linechart->yAxis->min = 0; $linechart->yAxis->labels->enabled = true; $linechart->xAxis->labels->enabled = true; $linechart->xAxis->categories = JAnalytics::getXAxisCategory($analyticsGroupBy); $linechart->legend->enabled = false; $linechart->credits->enabled = false; //$linechart->title->text = 'Line Chart'; $series1 = new HighRollerSeriesData(); $series1->addName('Activity')->addData($chartData1)->addColor('#82CAFA'); $series2 = new HighRollerSeriesData(); $series2->addName('Comments/Like')->addData($chartData2)->addColor('#6698FF'); $linechart->addSeries($series1); $linechart->addSeries($series2); $html = '<div id="linechart" style="height:160px"></div><script type="text/javascript">' . $linechart->renderChart() . '</script>'; return $html; }