1.Chart宽高当使用<1的值时,视为百分比宽高
2.Chart增加sub text输出支持
This commit is contained in:
parent
da5d328eb5
commit
30a26ac35d
@ -35,6 +35,7 @@
|
|||||||
private $width,$height;
|
private $width,$height;
|
||||||
|
|
||||||
private $title=null;
|
private $title=null;
|
||||||
|
private $sub_text=null;
|
||||||
|
|
||||||
private $tip_trigger=null;
|
private $tip_trigger=null;
|
||||||
private $tip_formatter=null;
|
private $tip_formatter=null;
|
||||||
@ -73,6 +74,11 @@
|
|||||||
$this->title=$t;
|
$this->title=$t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function set_sub_text($t)
|
||||||
|
{
|
||||||
|
$this->sub_text=$t;
|
||||||
|
}
|
||||||
|
|
||||||
public function set_tooltip($tt,$tf)
|
public function set_tooltip($tt,$tf)
|
||||||
{
|
{
|
||||||
$this->tip_trigger=$tt;
|
$this->tip_trigger=$tt;
|
||||||
@ -287,11 +293,17 @@
|
|||||||
|
|
||||||
if($this->width==0)
|
if($this->width==0)
|
||||||
echo '100%;height:';
|
echo '100%;height:';
|
||||||
|
else
|
||||||
|
if($this->width<=1)
|
||||||
|
echo ($this->width*100).'%;height:';
|
||||||
else
|
else
|
||||||
echo $this->width.'px;height:';
|
echo $this->width.'px;height:';
|
||||||
|
|
||||||
if($this->height==0)
|
if($this->height==0)
|
||||||
echo '100%;"></div>';
|
echo '100%;"></div>';
|
||||||
|
else
|
||||||
|
if($this->height<=1)
|
||||||
|
echo ($this->height*100).'%;"></div>';
|
||||||
else
|
else
|
||||||
echo $this->width.'px;"></div>';
|
echo $this->width.'px;"></div>';
|
||||||
|
|
||||||
@ -304,19 +316,22 @@
|
|||||||
';
|
';
|
||||||
|
|
||||||
if($this->title)
|
if($this->title)
|
||||||
echo 'title:{text:"'.$this->title.'"},';
|
{
|
||||||
|
echo 'title:{text:"'.$this->title.'"';
|
||||||
|
|
||||||
|
if($this->sub_text)
|
||||||
|
echo ',subtext:"'.$this->sub_text.'"';
|
||||||
|
|
||||||
|
echo '},';
|
||||||
|
}
|
||||||
|
|
||||||
echo 'tooltip:
|
echo 'tooltip:
|
||||||
{';
|
{';
|
||||||
if($this->tip_trigger||$this->tip_formatter)
|
|
||||||
{
|
|
||||||
|
|
||||||
if($this->tip_trigger)
|
if($this->tip_trigger)
|
||||||
echo 'trigger:"'.$this->tip_trigger.'",';
|
echo 'trigger:"'.$this->tip_trigger.'",';
|
||||||
|
|
||||||
if($this->tip_formatter)
|
if($this->tip_formatter)
|
||||||
echo 'formatter:"'.$this->tip_formatter.'"';
|
echo 'formatter:"'.$this->tip_formatter.'"';
|
||||||
}
|
|
||||||
echo '},';
|
echo '},';
|
||||||
|
|
||||||
if($this->save_as_image)
|
if($this->save_as_image)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user