diff options
author | Tyron Madlener <tyronx@gmail.com> | 2011-06-09 14:33:07 +0400 |
---|---|---|
committer | Tyron Madlener <tyronx@gmail.com> | 2011-06-09 14:33:07 +0400 |
commit | c928d53ef83438bbd1639a473dfcd4ecaa43101d (patch) | |
tree | 41da1e8806967f422585473fde72da12ea450d25 /tbl_chart.php | |
parent | f4fa0d9f797d36ccf648f32dcf4738b09e1ec457 (diff) |
Fix that single column results work too
Diffstat (limited to 'tbl_chart.php')
-rw-r--r-- | tbl_chart.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tbl_chart.php b/tbl_chart.php index c47b0f788d..49635175cf 100644 --- a/tbl_chart.php +++ b/tbl_chart.php @@ -104,10 +104,12 @@ url_query = '<?php echo $url_query;?>'; </span> <br> <input type="text" name="chartTitle" value="<?php echo __('Chart title'); ?>"> - <?php echo __('X-Axis:'); ?> <select name="chartXAxis"> + <?php $keys = array_keys($data[0]); + if(count($keys)>1) { + echo __('X-Axis:'); ?> <select name="chartXAxis"> <?php $yaxis=-1; - $keys = array_keys($data[0]); + foreach($keys as $idx=>$key) { if($yaxis==-1 && ($idx==count($data[0])-1 || preg_match("/(date|time)/i",$key))) { echo '<option value="'.$idx.'" selected>'.$key.'</option>'; @@ -119,6 +121,9 @@ url_query = '<?php echo $url_query;?>'; ?> </select> + <?php + } + ?> </div> <div style="float:left; padding-left:40px;"> <?php echo __('X-Axis label:'); ?> <input style="margin-top:0;" type="text" name="xaxis_label" value="<?php echo $keys[$yaxis]; ?>"><br> |