added font size setting

This commit is contained in:
Martynas Mickevicius
2010-07-28 11:02:17 +03:00
parent 8b7e8257b3
commit 4f62c6c2ea
3 changed files with 16 additions and 2 deletions

View File

@@ -93,6 +93,11 @@ function PMA_chart_results($data, &$chartSettings, &$chartErrors = array())
$chartSettings['continuous'] = 'off'; $chartSettings['continuous'] = 'off';
} }
// set default font size if needed
if (empty($chartSettings['fontSize'])) {
$chartSettings['fontSize'] = 8;
}
// default for legend // default for legend
$chartSettings['legend'] = false; $chartSettings['legend'] = false;

View File

@@ -59,7 +59,7 @@ abstract class PMA_pChart_Chart extends PMA_Chart
); );
} }
$this->chart->setFontProperties($this->getFontPath().'tahoma.ttf', 8); $this->chart->setFontProperties($this->getFontPath().'tahoma.ttf', $this->getFontSize());
$this->chart->setImageMap(true, 'mapid'); $this->chart->setImageMap(true, 'mapid');
} }
@@ -202,6 +202,11 @@ abstract class PMA_pChart_Chart extends PMA_Chart
return $this->settings['scale']; return $this->settings['scale'];
} }
protected function getFontSize()
{
return $this->settings['fontSize'];
}
protected function isContinuous() protected function isContinuous()
{ {
return $this->settings['continuous'] == 'on'; return $this->settings['continuous'] == 'on';

View File

@@ -153,11 +153,15 @@ $url_params['reload'] = 1;
<tr><td><label for="continuous"><?php echo __("Continuous image"); ?></label></td> <tr><td><label for="continuous"><?php echo __("Continuous image"); ?></label></td>
<td> <td>
<input type="checkbox" name="chartSettings[continuous]" <?php echo ($chartSettings['continuous'] == 'on' ? 'checked="checked"' : ''); ?>> <input type="checkbox" name="chartSettings[continuous]" id="continuous" <?php echo ($chartSettings['continuous'] == 'on' ? 'checked="checked"' : ''); ?>>
<i><?php echo _('(May not work on IE8)'); ?></i> <i><?php echo _('(May not work on IE8)'); ?></i>
</td> </td>
</tr> </tr>
<tr><td><label for="fontSize"><?php echo __("Font size"); ?></label></td>
<td><input type="text" name="chartSettings[fontSize]" id="fontSize" value="<?php echo (isset($chartSettings['fontSize']) ? $chartSettings['fontSize'] : ''); ?>" /></td>
</tr>
<?php if ($chartSettings['type'] == 'radar') { ?> <?php if ($chartSettings['type'] == 'radar') { ?>
<tr><td colspan="2"> <tr><td colspan="2">
<p> <p>