@datarailsshared/dr_renderer 1.2.197 → 1.2.199

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.197",
3
+ "version": "1.2.199",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -3276,6 +3276,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3276
3276
  enabled: false
3277
3277
  };
3278
3278
 
3279
+ chartOptions.xAxis.labels = {
3280
+ formatter: highchartsRenderer.getBreakdownXAxisLabelFormatter(chartOptions.series),
3281
+ };
3282
+
3279
3283
  return highchartsRenderer.ptCreateElementAndDraw(chartOptions, opts);
3280
3284
  };
3281
3285
 
@@ -6794,16 +6798,18 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
6794
6798
 
6795
6799
  highchartsRenderer.chartsTypesInfo = {
6796
6800
  [highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN]: {
6797
- name: 'Waterfall Breakdown Chart ',
6798
- label: 'Waterfall Breakdown Chart ',
6799
- title: 'TODO: add text',
6800
- description: 'TODO: add text',
6801
+ name: 'Breakdown Chart ',
6802
+ label: 'Breakdown Chart ',
6803
+ title: 'Analyzes what’s contributing to the financial increase or decrease.',
6804
+ description: 'For example, analyzes what’s contributing most to the difference in total revenue between last year and this year.',
6801
6805
  titleInEditor: 'This chart displays the breakdown of variance between two or more total values.',
6802
6806
  axisName: 'Category',
6803
6807
  legendName: 'Breakdown',
6804
6808
  startedMessage: 'To get started, drag one field to the Category and one field to the Value section.',
6805
- axisTooltipTitle: 'TODO: add text',
6806
- legendTooltipTitle: 'TODO: add text',
6809
+ axisTooltipTitle: 'Drag one field to configure your x-axis.',
6810
+ axisTooltipDescription: 'The category (usually an independent variable) is shown on the x-axis and should be between 2 to 5 total columns. ',
6811
+ legendTooltipTitle: 'Drag one field to further configure your x-axis.',
6812
+ legendTooltipDescription: 'The breakdown subdivides the chart by a category field for further analysis of what’s contributing to the increase or decrease.',
6807
6813
  },
6808
6814
  'combo-chart': {
6809
6815
  name: 'Combo Chart ',
@@ -7440,13 +7446,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7440
7446
  {
7441
7447
  type: 'waterfall-chart',
7442
7448
  name: 'Waterfall',
7443
- hidden: true,
7444
- class: 'google-visualization-charteditor-mini-column',
7449
+ class: 'google-visualization-charteditor-mini-waterfall',
7445
7450
  subtypes: [
7446
7451
  {
7447
7452
  type: highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN,
7448
7453
  name: highchartsRenderer.chartsTypesInfo[highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN].name,
7449
- class: 'google-visualization-charteditor-thumbs-columnchart',
7454
+ class: 'google-visualization-charteditor-thumbs-breakdown',
7450
7455
  render: highchartsRenderer.ptRenderWaterfallBreakdown,
7451
7456
  suboptions: [
7452
7457
  highchartsRenderer.suboptions["axisY"],
@@ -8674,6 +8679,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8674
8679
  return { rows, cols };
8675
8680
  }
8676
8681
 
8682
+ highchartsRenderer.getBreakdownXAxisLabelFormatter = function(chartSeries) {
8683
+ const styleForBreakdownLabel = 'font-weight: normal; color: #51566f;';
8684
+ return function() {
8685
+ const isTotal = lodash.some(chartSeries[0].data, point => point.name === this.value && point.isTotal);
8686
+ return `<span style="${ isTotal ? '' : styleForBreakdownLabel }">${ this.value }</span>`;
8687
+ }
8688
+ }
8689
+
8677
8690
  return highchartsRenderer;
8678
8691
  };
8679
8692