@datarailsshared/dr_renderer 1.2.190-dragons → 1.2.192-dragons
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/highcharts_renderer.js +14 -0
package/package.json
CHANGED
|
@@ -3261,6 +3261,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
3261
3261
|
enabled: false
|
|
3262
3262
|
};
|
|
3263
3263
|
|
|
3264
|
+
chartOptions.xAxis.labels = {
|
|
3265
|
+
formatter: highchartsRenderer.getBreakdownXAxisLabelFormatter(chartOptions.series),
|
|
3266
|
+
};
|
|
3267
|
+
|
|
3264
3268
|
return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
|
|
3265
3269
|
};
|
|
3266
3270
|
|
|
@@ -6783,6 +6787,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
6783
6787
|
label: 'Breakdown Chart ',
|
|
6784
6788
|
title: 'Explain financial outcomes differences.',
|
|
6785
6789
|
description: 'For example, describe the gaps between last and current year total revenue, breakdown by department.',
|
|
6790
|
+
titleInEditor: 'This chart displays the breakdown of variance between two or more total values.',
|
|
6786
6791
|
axisName: 'Category',
|
|
6787
6792
|
legendName: 'Breakdown',
|
|
6788
6793
|
startedMessage: 'To get started, drag one field to the Category and one field to the Value section.',
|
|
@@ -8659,6 +8664,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8659
8664
|
return { rows, cols };
|
|
8660
8665
|
}
|
|
8661
8666
|
|
|
8667
|
+
highchartsRenderer.getBreakdownXAxisLabelFormatter = function(chartSeries) {
|
|
8668
|
+
const styleForCategoryLabel = 'font-weight: 700; font-size: 12px;';
|
|
8669
|
+
const styleForBreakdownLabel = 'font-weight: 600; color: #6f6f6f; font-size: 11px;';
|
|
8670
|
+
return function() {
|
|
8671
|
+
const isTotal = lodash.some(chartSeries[0].data, point => point.name === this.value && point.isTotal);
|
|
8672
|
+
return `<span style="${ isTotal ? styleForCategoryLabel : styleForBreakdownLabel }">${ this.value }</span>`;
|
|
8673
|
+
}
|
|
8674
|
+
}
|
|
8675
|
+
|
|
8662
8676
|
return highchartsRenderer;
|
|
8663
8677
|
};
|
|
8664
8678
|
|