@datarailsshared/dr_renderer 1.2.251 → 1.2.252

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.251",
3
+ "version": "1.2.252",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -1366,7 +1366,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1366
1366
  className: SERIES_CLASSNAMES.WATERFALL_BREAKDOWN
1367
1367
  };
1368
1368
  resultObject = highchartsRenderer.getDataLabelsOptions(additionOptions, resultObject);
1369
-
1369
+ resultObject.name = pivotData.colAttrs[0];
1370
1370
  lodash.forEach(col_n_keys, function(col_n_value, col_index) {
1371
1371
 
1372
1372
  const totalColumnValue = pivotData.getAggregator([], col_n_value).value();
@@ -1415,6 +1415,20 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1415
1415
  });
1416
1416
  }
1417
1417
 
1418
+ chart_series.push(
1419
+ {
1420
+ name: 'Positive',
1421
+ visible: false,
1422
+ color: colorOptions.increase
1423
+ });
1424
+
1425
+ chart_series.push(
1426
+ {
1427
+ name: 'Negative',
1428
+ visible: false,
1429
+ color: colorOptions.decrease
1430
+ });
1431
+
1418
1432
  return chart_series;
1419
1433
  }
1420
1434
 
@@ -3352,9 +3366,21 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
3352
3366
  };
3353
3367
  }
3354
3368
 
3355
- chartOptions.legend = {
3356
- enabled: false
3357
- };
3369
+ chartOptions.legend = highchartsRenderer.getOptionsForLegends(additionOptions, 3, false);
3370
+ chartOptions.legend.useHTML = true;
3371
+ chartOptions.legend.labelFormatter = function() {
3372
+ const name = this.name;
3373
+ const findTotal = _.find(this.options.data, {isTotal: true});
3374
+ const color = lodash.get(findTotal, 'color') ? findTotal.color : this.color;
3375
+ return `<span style="margin: 5px; vertical-align: middle; display:inline-block; background-color: ${color};
3376
+ width: 12px; height: 12px; border-radius: 50%"></span>
3377
+ <span style="color: #000; display: inline-block; margin: 5px; vertical-align: middle;">${name}</span>`;
3378
+ }
3379
+
3380
+ chartOptions.legend.symbolPadding = 0;
3381
+ chartOptions.legend.symbolWidth = 0;
3382
+ chartOptions.legend.symbolHeight = 0;
3383
+ chartOptions.legend.squareSymbol = false;
3358
3384
 
3359
3385
  chartOptions.xAxis.labels = {
3360
3386
  formatter: highchartsRenderer.getBreakdownXAxisLabelFormatter(chartOptions.series),
@@ -7204,11 +7230,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7204
7230
  };
7205
7231
 
7206
7232
  highchartsRenderer.chartsTypesInfo = {
7233
+ 'waterfall-chart': {
7234
+ name: 'Waterfall Chart',
7235
+ label: 'Waterfall Chart',
7236
+ title: 'Describe and explain changes in your financial outcomes.',
7237
+ },
7207
7238
  [highchartsRenderer.CHART_TYPES.WATERFALL_BREAKDOWN]: {
7208
- name: 'Breakdown Chart ',
7209
- label: 'Breakdown Chart ',
7210
- title: 'Analyzes what’s contributing to the financial increase or decrease.',
7211
- description: 'For example, analyzes what’s contributing most to the difference in total revenue between last year and this year.',
7239
+ name: 'Breakdown Chart',
7240
+ label: 'Breakdown Chart',
7241
+ title: 'Describe and explain changes in your financial outcomes.',
7242
+ description: `For example, describe the gaps between income and your gross profit or describe the \n
7243
+ gaps between last and current year total revenue, breakdown by locations.`,
7212
7244
  titleInEditor: 'This chart displays the breakdown of variance between two or more total values.',
7213
7245
  axisName: 'Category',
7214
7246
  legendName: 'Breakdown',
@@ -7219,10 +7251,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7219
7251
  legendTooltipDescription: 'The breakdown subdivides the chart by a category field for further analysis of what’s contributing to the increase or decrease.',
7220
7252
  },
7221
7253
  [highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
7222
- name: 'Waterfall Walkthrough Chart ',
7223
- label: 'Waterfall Walkthrough Chart ',
7224
- title: 'TODO: add text',
7225
- description: 'TODO: add text',
7254
+ name: 'Walkthrough Chart',
7255
+ label: 'Walkthrough Chart',
7256
+ title: 'Describe and explain changes in your financial outcomes.',
7257
+ titleInEditor: 'TODO: add text',
7258
+ description: 'For example, describe the gaps between income and your gross profit.',
7226
7259
  axisName: 'Category',
7227
7260
  startedMessage: 'TODO: add text',
7228
7261
  axisTooltipTitle: 'TODO: add text',
@@ -7886,7 +7919,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7886
7919
  {
7887
7920
  type: highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH,
7888
7921
  name: highchartsRenderer.chartsTypesInfo[highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH].name,
7889
- class: 'google-visualization-charteditor-thumbs-columnchart',
7922
+ class: 'google-visualization-charteditor-thumbs-walkthrough',
7890
7923
  render: highchartsRenderer.ptRenderWaterfallWalkthrough,
7891
7924
  suboptions: [
7892
7925
  highchartsRenderer.suboptions["axisX"],
@@ -7898,8 +7931,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7898
7931
  highchartsRenderer.suboptions["negative_number_format"],
7899
7932
  highchartsRenderer.suboptions["advanced"],
7900
7933
  highchartsRenderer.suboptions["legends"],
7901
- ],
7902
- hidden: true,
7934
+ ]
7903
7935
  },
7904
7936
  ]
7905
7937
  },