@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.191-dragons",
3
+ "version": "1.2.192-dragons",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -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