diff --git a/classes/HighChart.php b/classes/HighChart.php index 14fe17e..c4b3e88 100644 --- a/classes/HighChart.php +++ b/classes/HighChart.php @@ -20,6 +20,7 @@ abstract class HighChart { // Default chart size. protected $_height = '300'; protected $_width = '575'; + protected $_ymetric = ''; // Colors to use for series private $_series_colours = array('AAACCC','E0E0E0','CCC888','EEEBBB','666CCC','888888'); @@ -40,6 +41,8 @@ abstract class HighChart { break; case 'width': $this->_width = array_shift($args); break; + case 'ymetric': $this->_ymetric = array_shift($args); + break; default: throw new Kohana_Exception('Unknown method :name',array(':name'=>$name)); } diff --git a/classes/HighChart/Combo.php b/classes/HighChart/Combo.php index 8d1a036..18969dc 100644 --- a/classes/HighChart/Combo.php +++ b/classes/HighChart/Combo.php @@ -91,7 +91,7 @@ $(document).ready(function() { }, yAxis: { title: { - text: 'MB' + text: '".$this->_ymetric."' }, labels: { formatter: function() { @@ -102,7 +102,7 @@ $(document).ready(function() { tooltip: { formatter: function() { var s; - s = '' + (this.point.name ? this.point.name+': ' : '') + this.y +' MB'; + s = '' + (this.point.name ? this.point.name+': ' : '') + this.y +' ".$this->_ymetric."'; return s; } },