@datarailsshared/dr_renderer 1.5.126 → 1.5.131
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
|
@@ -8238,10 +8238,11 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
|
8238
8238
|
lodash.forEach(values, (value, key) => {
|
|
8239
8239
|
const formatInfo = pivotData[type][key] || {};
|
|
8240
8240
|
const valueToFloat = parseFloat(value);
|
|
8241
|
+
const isBlankDate = formatInfo.type === 'Date' && (value === '' || value === '[blank]');
|
|
8241
8242
|
const isDate = formatInfo.type === 'Date' && (moment_lib(valueToFloat).isValid() || moment_lib(value, formatInfo.format).isValid());
|
|
8242
8243
|
const isNumberFormatting = !isDate && formatInfo.format && highchartsRenderer.isFormattingNumberAxis(pivotData);
|
|
8243
8244
|
|
|
8244
|
-
if (isNumberFormatting || isDate) {
|
|
8245
|
+
if (isNumberFormatting || isDate || isBlankDate) {
|
|
8245
8246
|
values[key] = highchartsRenderer.returnRawDataValue(
|
|
8246
8247
|
formatInfo.type,
|
|
8247
8248
|
!isNaN(valueToFloat) ? valueToFloat : value,
|
package/src/options/builders.js
CHANGED
|
@@ -359,8 +359,8 @@ const withLabelWithPercentagePercentStacked = () => {
|
|
|
359
359
|
createToggle('hide_subtotals', 'Hide subtotals', false),
|
|
360
360
|
...createLabelStyleGroup(),
|
|
361
361
|
createDivider(),
|
|
362
|
-
createCheckbox('show_value', 'Value',
|
|
363
|
-
createCheckbox('show_out_of_x_axis', '% Out of [X Axis]',
|
|
362
|
+
createCheckbox('show_value', 'Value', false, { clickFn: labelValueClickFn }),
|
|
363
|
+
createCheckbox('show_out_of_x_axis', '% Out of [X Axis]', true, { clickFn: labelValueClickFn }),
|
|
364
364
|
createCheckbox('show_out_of_data_series', '% Out of [Data Series]', false, { clickFn: labelValueClickFn }),
|
|
365
365
|
// present_total and show_percentage removed - total is always 100% for percent stacking
|
|
366
366
|
]);
|
|
@@ -469,8 +469,8 @@ Object {
|
|
|
469
469
|
"shadow": false,
|
|
470
470
|
"show": true,
|
|
471
471
|
"show_out_of_data_series": false,
|
|
472
|
-
"show_out_of_x_axis":
|
|
473
|
-
"show_value":
|
|
472
|
+
"show_out_of_x_axis": true,
|
|
473
|
+
"show_value": false,
|
|
474
474
|
"vertical": false,
|
|
475
475
|
},
|
|
476
476
|
"legends_position": Object {
|
|
@@ -784,8 +784,8 @@ Object {
|
|
|
784
784
|
"shadow": false,
|
|
785
785
|
"show": true,
|
|
786
786
|
"show_out_of_data_series": false,
|
|
787
|
-
"show_out_of_x_axis":
|
|
788
|
-
"show_value":
|
|
787
|
+
"show_out_of_x_axis": true,
|
|
788
|
+
"show_value": false,
|
|
789
789
|
"vertical": false,
|
|
790
790
|
},
|
|
791
791
|
"legends_position": Object {
|
|
@@ -3515,14 +3515,14 @@ Object {
|
|
|
3515
3515
|
},
|
|
3516
3516
|
Object {
|
|
3517
3517
|
"clickFn": "[Function]",
|
|
3518
|
-
"default_value":
|
|
3518
|
+
"default_value": false,
|
|
3519
3519
|
"element_label": "Value",
|
|
3520
3520
|
"element_type": "checkbox",
|
|
3521
3521
|
"value_name": "show_value",
|
|
3522
3522
|
},
|
|
3523
3523
|
Object {
|
|
3524
3524
|
"clickFn": "[Function]",
|
|
3525
|
-
"default_value":
|
|
3525
|
+
"default_value": true,
|
|
3526
3526
|
"element_label": "% Out of [X Axis]",
|
|
3527
3527
|
"element_type": "checkbox",
|
|
3528
3528
|
"value_name": "show_out_of_x_axis",
|
|
@@ -5120,6 +5120,17 @@ describe('highcharts_renderer', () => {
|
|
|
5120
5120
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
|
5121
5121
|
expect(formattedKey).toEqual(initialKey);
|
|
5122
5122
|
});
|
|
5123
|
+
|
|
5124
|
+
// some e2e tests exist that expects this behavior
|
|
5125
|
+
it('should format blank value with [blank] text', () => {
|
|
5126
|
+
const initialKey = ['DR_Others', ''];
|
|
5127
|
+
const pivotData = {
|
|
5128
|
+
colFormats: [{ type: "Text", name: "Month" }, { type: 'Date', name: "Date" }],
|
|
5129
|
+
};
|
|
5130
|
+
const type = 'colFormats';
|
|
5131
|
+
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
|
5132
|
+
expect(formattedKey).toEqual(['DR_Others', '[blank]']);
|
|
5133
|
+
});
|
|
5123
5134
|
});
|
|
5124
5135
|
});
|
|
5125
5136
|
|