diff --git a/lib/zin/wg/graph/v1.php b/lib/zin/wg/graph/v1.php index 44e5eeb367..f1af25cc13 100644 --- a/lib/zin/wg/graph/v1.php +++ b/lib/zin/wg/graph/v1.php @@ -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)),