Example #1
0
 /**
  * Get monthly used space evolution chart
  * @return String
  */
 private static function loadHistoMonthlyUsedSpaceChart()
 {
     $units = array('', 'KB', 'MB', 'GB', 'TB');
     $u = OC_DLStCharts::getUConfValue('hu_size_hus', array('uc_val' => 3));
     $u = $units[$u['uc_val']];
     return 'histous=new Highcharts.Chart({chart:{renderTo:\'histo_us\',backgroundColor:\'#F8F8F8\',plotBackgroundColor:\'#F8F8F8\',type:\'column\'},title:{text:\'\'},xAxis:{categories:["' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 11)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 11)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 10)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 10)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 9)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 9)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 8)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 8)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 7)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 7)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 6)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 6)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 5)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 5)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 4)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 4)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 3)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 3)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 2)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 2)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m') - 1)))) . ' ' . date('Y', mktime(0, 0, 0, date('m') - 1)) . '","' . self::$l->t(ucfirst(date('F', mktime(0, 0, 0, date('m'))))) . ' ' . date('Y', mktime(0, 0, 0, date('m'))) . '"]},yAxis:{min:0,title:{text:\'' . self::$l->t('Average used space') . ' (' . $u . ')\'},stackLabels:{enabled:true,style:{fontWeight:\'bold\',color:(Highcharts.theme&&Highcharts.theme.textColor)||\'gray\'},formatter:function() {return(Math.round(this.total*100)/100);}}},legend:{align:\'center\',x:-20,verticalAlign:\'top\',y:20,floating:true,backgroundColor:(Highcharts.theme&&Highcharts.theme.legendBackgroundColorSolid)||\'white\',borderColor:\'#CCC\',borderWidth:1,shadow:false},tooltip:{formatter:function() {return \'<b>\'+this.x+\'</b><br/>\'+this.series.name+\': \'+(Math.round(this.y*100)/100)+\' ' . $u . '<br/>\'+\'Total: \'+(Math.round(this.point.stackTotal*100)/100)+\' ' . $u . '\';}},plotOptions:{column:{stacking:\'normal\',dataLabels:{enabled:false,color:(Highcharts.theme&&Highcharts.theme.dataLabelsColor)||\'white\'}}},series:[' . OC_DLStCharts::arrayParser('histo', OC_DLStCharts::getUsedSpaceOverTime('monthly'), self::$l, ',', 'hu_size_hus') . '],exporting:{enabled:false}});';
 }