- πΊπΈUnited States bluegeek9
Thank you for your contributions to this issue. As Drupal 7 has reached its End of Life and is no longer supported, we are closing this issue. We encourage you to upgrade to a supported version of Drupal.
Hi, I try to set decimal_value property for a serie to 0 because I want no decimals but nothings happens. I check the code and I note that the conditions that define de number format not allow me to set what I want. I fix the problem doing the following changes:
@@ -233,17 +233,18 @@ function _charts_highcharts_populate_chart_data(&$chart, $chart_definition) {
$series['tooltip']['valueDecimals'] = $chart[$key]['#decimal_count'];
$series['tooltip']['xDateFormat'] = $chart[$key]['#date_format'];
$series['tooltip']['valuePrefix'] = $chart[$key]['#prefix'];
$series['tooltip']['valueSuffix'] = $chart[$key]['#suffix'];
- if ($chart[$key]['#prefix'] || $chart[$key]['#suffix']) {
+ if ($chart[$key]['#prefix'] || $chart[$key]['#suffix'] || isset($chart[$key]['#decimal_count'])) {
$yaxis_index = isset($series['yAxis']) ? $series['yAxis'] : 0;
// For axis formatting, we need to use a format string.
// See http://docs.highcharts.com/#formatting.
- $decimal_formatting = $chart[$key]['#decimal_count'] ? (':.' . $chart[$key]['#decimal_count'] . 'f') : '';
+ $decimal_formatting = isset($chart[$key]['#decimal_count']) ? (':.' . $chart[$key]['#decimal_count'] . 'f') : '';
$chart_definition['yAxis'][$yaxis_index]['labels']['format'] = $chart[$key]['#prefix'] . "{value$decimal_formatting}" . $chart[$key]['#suffix'];
}
// Remove unnecessary keys to trim down the resulting JS settings.
charts_trim_array($series);
Please review this changes and consider integrating.
Regards
Closed: outdated
Highcharts integration
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Thank you for your contributions to this issue. As Drupal 7 has reached its End of Life and is no longer supported, we are closing this issue. We encourage you to upgrade to a supported version of Drupal.