@datarailsshared/dr_renderer 1.2.191-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 +13 -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
|
|
|
@@ -8660,6 +8664,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8660
8664
|
return { rows, cols };
|
|
8661
8665
|
}
|
|
8662
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
|
+
|
|
8663
8676
|
return highchartsRenderer;
|
|
8664
8677
|
};
|
|
8665
8678
|
|