@datarailsshared/dr_renderer 1.2.339 → 1.2.340

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.339",
3
+ "version": "1.2.340",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -145,6 +145,8 @@ const FEATURES = {
145
145
  FORMAT_AXIS: 'use_default_table_format_for_axis',
146
146
  }
147
147
 
148
+ const TICKS_COUNT = 5;
149
+
148
150
  let getHighchartsRenderer = function ($, document, Highcharts, default_colors, highchartsRenderer,
149
151
  DataFormatter, lodash, moment_lib, isNewAngular) {
150
152
 
@@ -1157,7 +1159,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1157
1159
  if (row_n_value && row_n_value.length > 0) {
1158
1160
  ob.initialName = row_n_value.join(highchartsRenderer.delimer)
1159
1161
  .replace(highchartsRenderer.DR_OTHERS_KEY, othersName);
1160
- ob.name = highchartsRenderer.getFormattedRowKey(ob.initialName, pivotData);
1162
+ ob.name = highchartsRenderer.getFormattedRowKey(ob.initialName, pivotData);
1161
1163
  }
1162
1164
  lodash.forEach(col_n_keys, function (col_n_value, index) {
1163
1165
  var agg = pivotData.getAggregator(row_n_value, col_n_value);
@@ -1200,7 +1202,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1200
1202
 
1201
1203
  ob.data.push(
1202
1204
  key
1203
- ? {
1205
+ ? {
1204
1206
  y: val,
1205
1207
  initialName: lodash.unescape(key),
1206
1208
  name: highchartsRenderer.getFormattedColKey(lodash.unescape(key), pivotData),
@@ -1661,7 +1663,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1661
1663
 
1662
1664
  let initialName = value.trend === 'total' ? value.formattedKey || value.key[0] : keys.join(highchartsRenderer.delimer);
1663
1665
  let name = value.trend === 'total' ? initialName : highchartsRenderer.getFormattedColKey(initialName, pivotData);
1664
-
1666
+
1665
1667
  let color = '';
1666
1668
 
1667
1669
  if (!lodash.get(waterfallOptions, 'colors', {}) && value.color) {
@@ -4819,7 +4821,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4819
4821
  result = {};
4820
4822
  }
4821
4823
  }
4822
-
4824
+
4823
4825
  return result;
4824
4826
  };
4825
4827
 
@@ -9123,7 +9125,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9123
9125
 
9124
9126
  return topPosition;
9125
9127
  }
9126
-
9128
+ highchartsRenderer.setStaticTicksAmount = function (yAxis) {
9129
+ yAxis.tickAmount = TICKS_COUNT;
9130
+ }
9127
9131
  highchartsRenderer.setYAxisMinMax = function (yAxis, axisYOptions) {
9128
9132
  if (!axisYOptions) {
9129
9133
  return;
@@ -9133,6 +9137,9 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9133
9137
  const maxNumber = parseInt(axisYOptions.max);
9134
9138
  yAxis.min = !isNaN(minNumber) ? minNumber : null;
9135
9139
  yAxis.max = !isNaN(maxNumber) ? maxNumber : null;
9140
+ if (minNumber || maxNumber) {
9141
+ highchartsRenderer.setStaticTicksAmount(yAxis);
9142
+ }
9136
9143
  }
9137
9144
 
9138
9145
  highchartsRenderer.getDateFieldFormat = function(widget, dateField) {
@@ -9385,7 +9392,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9385
9392
  }
9386
9393
 
9387
9394
  highchartsRenderer.getColsInFormatterContext = function(context, pivotData) {
9388
- return lodash.get(context, 'point.options.colsForTotal')
9395
+ return lodash.get(context, 'point.options.colsForTotal')
9389
9396
  || highchartsRenderer.isFormattingAxis(pivotData) && (lodash.get(context, 'point.initialName') || lodash.get(context, 'options.initialName'))
9390
9397
  || context.key;
9391
9398
  }