I would like to make 100% width , but Flot module throws an error message.
Example:
$variables = array(
'data' => array($d1, $d2),
'element' => array(
'id' => 'flot-example-normal',
'class' => 'flot-example',
'style' => "width:100%; height:300px",
),
'legend' => TRUE,
'zoom' => TRUE,
);
I get: Notice: Undefined offset: 1 in template_preprocess_flot_graph() (line 173 of ... all/modules/contrib/flot/flot.module).
I would recommend to refine the regex and remove px.
preg_match('/width:(.*)px;/', $variables['element']['graph']['style'], $width);
to this:
preg_match('/width:(.*);/', $variables['element']['graph']['style'], $width);
Comments
Comment #1
attiks commented@minnur can you provide a patch?
Comment #2
orange-wedge commentedThe error is this:
Notice: Undefined offset: 1 in template_preprocess_flot_graph()
The fix recommended is partially correct. You would need to change the $zoom_element array too:
Comment #3
orange-wedge commentedComment #4
beakerboy