diff --git a/views/charts_plugin_style_chart.inc b/views/charts_plugin_style_chart.inc index f991d15..a6171e5 100644 --- a/views/charts_plugin_style_chart.inc +++ b/views/charts_plugin_style_chart.inc @@ -321,6 +321,18 @@ class charts_plugin_style_chart extends views_plugin_style { // Merge in the child chart data. foreach (element_children($subchart) as $key) { if ($subchart[$key]['#type'] === 'chart_data') { + $data = array(); + $subchart_xaxis_labels = $subchart['xaxis']['#labels']; + foreach ($chart['xaxis']['#labels'] as $id => $label) { + $index = array_search($label, $subchart_xaxis_labels); + if ($index === FALSE) { + $data[$id] = 0; + } + else { + $data[$id] = $subchart[$key]['#data'][$index]; + } + } + $subchart[$key]['#data'] = $data; $chart[$key] = $subchart[$key]; // If the subchart is a different type than the parent chart, set // the #chart_type property on the individual chart data elements.