Description:

$users_active = array();
$users_crashed = array();
$upgrades_model = new Upgrades_Model;
$model_data = $upgrades_model->getActiveByVersion($product_id);
foreach ($model_data as $version_data) {
$users_active[$Product->formatVersion($version_data->version)] = $version_data->count;
}
$data = $users_active;
$shutdowns_model = new Shutdowns_Model;
$model_data = $shutdowns_model->getByUserByVersion($product_id);
foreach ($model_data as $version_data) {
$version = $Product->formatVersion($version_data->version);
if (isset($users_active[$version])) {
$users_crashed[$version] = $version_data->count;
}
}
...
$graph->background->background = '#ffffff';
$graph->data['Active Users'] = new ezcGraphArrayDataSet($users_active);
$graph->data['Active Users']->highlight = true;
if (count($users_crashed) > 0) {
$graph->data['Crashed Users'] = new ezcGraphArrayDataSet($users_crashed);
$graph->data['Crashed Users']->highlight = true;
}
// Graph options
$graph->xAxis->labelCount = max(2, count($users_active), count($users_crashed));
$graph->options->highlightSize = 8;
$graph->yAxis->min = 0;
$graph->xAxis->axisLabelRenderer = new ezcGraphAxisRotatedLabelRenderer();
$graph->xAxis->axisLabelRenderer->angle = 10;
$graph->xAxis->axisSpace = .2;
$graph->xAxis->font->maxFontSize = 5;
...
$graph = new ezcGraphBarChart();
$graph->title = 'Users by Version';
$graph->legend->portraitSize = .1;
...
$graph->driver = new ezcGraphGdDriver();
$graph->options->font = $this->font;
$graph->options->font->minFontSize = 5;
$graph->options->font->maxFontSize = 12;
// Set the font size for the title independently to 14
$graph->title->font->maxFontSize = 14;
Environment:
Operating System:
PHP Version: (please be specific, like '4.4.3' or '5.1.5')
Database and version:
Browser (and version):
|
|