Chart\InlinePie: locale-ignorant casts for floats
PHP respects locales (LC_NUMERIC) when casting floats to string. That affected the generated HTML for our inline pie charts. This patch is not that beautiful - but fixes this. fixes #6348
This commit is contained in:
parent
7a0173e2fb
commit
92f454c36d
|
@ -220,12 +220,17 @@ EOD;
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$template = $this->template;
|
$template = $this->template;
|
||||||
|
// Locale-ignorant string cast:
|
||||||
|
$data = array();
|
||||||
|
foreach ($this->data as $dat) {
|
||||||
|
$data[] = sprintf('%F', $dat);
|
||||||
|
}
|
||||||
$template = preg_replace('{{url}}', $this->url, $template);
|
$template = preg_replace('{{url}}', $this->url, $template);
|
||||||
$template = preg_replace('{{width}}', $this->width, $template);
|
$template = preg_replace('{{width}}', $this->width, $template);
|
||||||
$template = preg_replace('{{height}}', $this->height, $template);
|
$template = preg_replace('{{height}}', $this->height, $template);
|
||||||
$template = preg_replace('{{title}}', $this->title, $template);
|
$template = preg_replace('{{title}}', $this->title, $template);
|
||||||
$template = preg_replace('{{style}}', $this->style, $template);
|
$template = preg_replace('{{style}}', $this->style, $template);
|
||||||
$template = preg_replace('{{data}}', implode(',', $this->data), $template);
|
$template = preg_replace('{{data}}', implode(',', $data), $template);
|
||||||
$template = preg_replace('{{colors}}', implode(',', $this->colors), $template);
|
$template = preg_replace('{{colors}}', implode(',', $this->colors), $template);
|
||||||
return $template;
|
return $template;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue