* [refac bug #57397] Adjust graph wg.

This commit is contained in:
wangyidong
2024-11-28 17:34:10 +08:00
committed by 孙广明
parent 4ce078940b
commit 3186d4daec
+5 -2
View File
@@ -9,14 +9,17 @@ class graph extends wg
'responsive?: bool=false',
'width?: number|string="100%"',
'height?: number|string="500"',
'graphID?: number=0',
);
protected function build(): zui
{
list($type, $width, $height, $responsive) = $this->prop(array('type', 'width', 'height', 'responsive'));
list($type, $width, $height, $responsive, $graphID) = $this->prop(array('type', 'width', 'height', 'responsive', 'graphID'));
if(empty($graphID)) $graphID = uniqid();
return zui::graph(
set::_id('zin_graph_' . uniqid()),
set::_id('zin_graph_' . $graphID),
set::type($type),
set::responsive($responsive),
set::_style(array('width' => is_int($width) ? "{$width}px" : $width, 'height' => is_int($height) ? "{$height}px" : $height)),