[Vertical Bar Charts] Preserve order after truncate label
This commit is contained in:
parent
3359870c2f
commit
287d28de4e
|
@ -188,9 +188,9 @@ function vbar_graph(
|
||||||
$tick_color);
|
$tick_color);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$new_chart_data = array();
|
||||||
foreach ($chart_data as $key => $value) {
|
foreach ($chart_data as $key => $value) {
|
||||||
if(strlen($key) > 20){
|
if(strlen($key) > 20){
|
||||||
|
|
||||||
if(strpos($key, ' - ') != -1){
|
if(strpos($key, ' - ') != -1){
|
||||||
$key_temp = explode(" - ",$key);
|
$key_temp = explode(" - ",$key);
|
||||||
$key_temp[0] = $key_temp[0]." \n";
|
$key_temp[0] = $key_temp[0]." \n";
|
||||||
|
@ -198,14 +198,14 @@ function vbar_graph(
|
||||||
$key2 = $key_temp[0].$key_temp[1];
|
$key2 = $key_temp[0].$key_temp[1];
|
||||||
io_safe_output($key2);
|
io_safe_output($key2);
|
||||||
}
|
}
|
||||||
$chart_data[$key2]['g'] = $chart_data[$key]['g'];
|
$new_chart_data[$key2]['g'] = $chart_data[$key]['g'];
|
||||||
unset($chart_data[$key]);
|
} else {
|
||||||
|
$new_chart_data[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$graph = array();
|
$graph = array();
|
||||||
$graph['data'] = $chart_data;
|
$graph['data'] = $new_chart_data;
|
||||||
$graph['width'] = $width;
|
$graph['width'] = $width;
|
||||||
$graph['height'] = $height;
|
$graph['height'] = $height;
|
||||||
$graph['color'] = $color;
|
$graph['color'] = $color;
|
||||||
|
|
Loading…
Reference in New Issue