Пример #1
0
 public function testTooltip()
 {
     $tooltip = new Tooltip(['formatter' => new JsExpression('function(){ return \'<b>\' + this.series.name + \'</b><br/>\' + this.x + \': +\' + this.y; }')]);
     $this->assertEquals('{"formatter":function(){ return \'<b>\' + this.series.name + \'</b><br/>\' + this.x + \': +\' + this.y; }}', $tooltip->toJson());
     $tooltip = new Tooltip();
     $tooltip->setPointFormat('{series.name}: <b>{point.y}</b><br/>');
     $tooltip->setValueSuffix(' cm');
     $tooltip->setShared(true);
     $this->assertEquals('{"pointFormat":"{series.name}: <b>{point.y}</b><br/>","valueSuffix":" cm","shared":true}', $tooltip->toJson());
 }