@rowsncolumns/charts 28.1.11 → 28.1.13
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/dist/cjs/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/cjs/basic-chart/basic-chart.js +462 -286
- package/dist/cjs/basic-chart/helpers.d.ts.map +1 -1
- package/dist/cjs/basic-chart/helpers.js +2 -0
- package/dist/cjs/plotly/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/cjs/plotly/basic-chart/basic-chart.js +198 -149
- package/dist/cjs/plotly/basic-chart/helpers.d.ts.map +1 -1
- package/dist/cjs/plotly/basic-chart/helpers.js +2 -0
- package/dist/cjs/utils/hierarchy.d.ts +6 -0
- package/dist/cjs/utils/hierarchy.d.ts.map +1 -1
- package/dist/cjs/utils/hierarchy.js +23 -1
- package/dist/cjs/utils/histogram.d.ts +42 -3
- package/dist/cjs/utils/histogram.d.ts.map +1 -1
- package/dist/cjs/utils/histogram.js +193 -5
- package/dist/cjs/utils/overrides.d.ts +1 -1
- package/dist/cjs/utils/overrides.d.ts.map +1 -1
- package/dist/cjs/utils/overrides.js +44 -39
- package/dist/esm/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/esm/basic-chart/basic-chart.js +297 -109
- package/dist/esm/basic-chart/helpers.d.ts.map +1 -1
- package/dist/esm/basic-chart/helpers.js +2 -0
- package/dist/esm/plotly/basic-chart/basic-chart.d.ts.map +1 -1
- package/dist/esm/plotly/basic-chart/basic-chart.js +132 -70
- package/dist/esm/plotly/basic-chart/helpers.d.ts.map +1 -1
- package/dist/esm/plotly/basic-chart/helpers.js +2 -0
- package/dist/esm/utils/hierarchy.d.ts +6 -0
- package/dist/esm/utils/hierarchy.d.ts.map +1 -1
- package/dist/esm/utils/hierarchy.js +21 -0
- package/dist/esm/utils/histogram.d.ts +42 -3
- package/dist/esm/utils/histogram.d.ts.map +1 -1
- package/dist/esm/utils/histogram.js +171 -4
- package/dist/esm/utils/overrides.d.ts +1 -1
- package/dist/esm/utils/overrides.d.ts.map +1 -1
- package/dist/esm/utils/overrides.js +4 -2
- package/package.json +2 -2
|
@@ -126,7 +126,14 @@ var HIERARCHY_LEVEL_STYLES = [
|
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
itemStyle: {
|
|
129
|
-
gapWidth:
|
|
129
|
+
gapWidth: 2,
|
|
130
|
+
borderColor: "#ffffff",
|
|
131
|
+
borderWidth: 1,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
itemStyle: {
|
|
136
|
+
gapWidth: 0,
|
|
130
137
|
borderColor: "#ffffff",
|
|
131
138
|
borderWidth: 1,
|
|
132
139
|
},
|
|
@@ -149,11 +156,20 @@ var treemapBannerShown = function (layout) { return layout !== "none"; };
|
|
|
149
156
|
* Colour a hierarchy like Excel: each top-level node takes the next
|
|
150
157
|
* palette colour and every descendant inherits it (#1072).
|
|
151
158
|
*/
|
|
152
|
-
var colorHierarchyNodes = function (nodes, palette) {
|
|
159
|
+
var colorHierarchyNodes = function (nodes, palette, options) {
|
|
160
|
+
if (options === void 0) { options = {}; }
|
|
153
161
|
return nodes.map(function (node, index) {
|
|
154
162
|
var color = (0, utils_1.chartPaletteColorAt)(palette, index);
|
|
155
|
-
var paint = function (n) { return (tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, n), {
|
|
156
|
-
|
|
163
|
+
var paint = function (n, depth) { return (tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, n), {
|
|
164
|
+
// A top-level node's "border" is what echarts paints behind its
|
|
165
|
+
// banner strip: fill it with the category colour and write the name
|
|
166
|
+
// in a contrasting colour, like Excel's banner (#1086).
|
|
167
|
+
itemStyle: depth === 0 && options.banner
|
|
168
|
+
? { color: color, borderColor: color }
|
|
169
|
+
: { color: color } }), (depth === 0 && options.banner
|
|
170
|
+
? { upperLabel: { color: (0, hierarchy_1.contrastTextColor)(color) } }
|
|
171
|
+
: {})), (n.children ? { children: n.children.map(function (c) { return paint(c, depth + 1); }) } : {}))); };
|
|
172
|
+
return paint(node, 0);
|
|
157
173
|
});
|
|
158
174
|
};
|
|
159
175
|
/** Sunburst rings: Excel leaves the centre empty, so even the first level is a ring (#1073). */
|
|
@@ -412,11 +428,11 @@ var BasicChart = function (_a) {
|
|
|
412
428
|
* Triggers a chart update
|
|
413
429
|
*/
|
|
414
430
|
var updateChart = function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
|
|
415
|
-
var threeDRenderKind, canRender3D, willRender3D, isRegionMap, regionSpec, geoScope, geo, labels, seriesEntry, values, _a, data, unmatched, min, max, textColor, ramp, noDataColor, borderColor, regionSeriesLabel, seriesName, chartDomains, chartSeries, legend, chartType, position, showAxis, isBubble, isHierarchy, skipHeaders_1, labelValues, perSeriesX, perSeriesSize, seriesInputs, i, seriesEntry, resolvedLabel, _b, xValues, sizeValues_1, sharedXValues, sharedSizeValues, _c, categories_1, preparedSeries, sizeValues, sizeScale_1, bubblePalette_1, bubbleItemColor_1, hasBubbleSecondaryAxis, xAxisConfig, tooltipFormatter, bubbleSeriesLabelFor_1, bubbleSeries, bubbleOverlays, hierarchyRows, headerTitle, hierarchyPalette, hierarchyData, rootName, drillDown, seriesDisplayName, hierarchyDepth,
|
|
416
|
-
var e_1,
|
|
417
|
-
var _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149;
|
|
418
|
-
return tslib_1.__generator(this, function (
|
|
419
|
-
switch (
|
|
431
|
+
var threeDRenderKind, canRender3D, willRender3D, isRegionMap, regionSpec, geoScope, geo, labels, seriesEntry, values, _a, data, unmatched, min, max, textColor, ramp, noDataColor, borderColor, regionSeriesLabel, seriesName, chartDomains, chartSeries, legend, chartType, position, showAxis, isBubble, isHierarchy, skipHeaders_1, labelValues, perSeriesX, perSeriesSize, seriesInputs, i, seriesEntry, resolvedLabel, _b, xValues, sizeValues_1, sharedXValues, sharedSizeValues, _c, categories_1, preparedSeries, sizeValues, sizeScale_1, bubblePalette_1, bubbleItemColor_1, hasBubbleSecondaryAxis, xAxisConfig, tooltipFormatter, bubbleSeriesLabelFor_1, bubbleSeries, bubbleOverlays, bubbleLegend, bubbleBand, hierarchyRows, headerTitle, hierarchyPalette, isTreemap, banner, hierarchyData, rootName, drillDown, seriesDisplayName, hierarchyDepth, levels, hierarchyLegend, legendShown, categoryLegendSeries, sizeNumberFormat_1, tooltipFormatter, hierarchyDataLabels, hierarchyLabelOpts, hierarchyLabel, hierarchyBand, isContour, categories_2, contourSeriesInputs, _d, _e, seriesEntry, dataLabel, _f, _g, values, e_1_1, seriesNames_1, contourPoints, _h, zMin, zMax, contourFormats_1, contourLabel, categories_3, threeDSeriesInputs, _j, _k, seriesEntry, dataLabel, _l, _m, values, e_2_1, seriesNames_2, threeDPalette_1, seriesColorAt_1, categoryAxisLabel, seriesAxisLabel, stackedBar3D_1, threeDFormats_1, threeDTooltipFormatter, threeDSeries, visualMap, xAxis3D, yAxis3D, categoryCount, categoryTotals_1, threeDSeriesInputs_1, threeDSeriesInputs_1_1, entry, isPercent_1, surfacePoints, _o, zMin, zMax, skipHeaders, categories, radarSeriesInputs, _p, _q, seriesEntry, label, values, radarAxisOptions_1, indicators_1, radarData, radarStyle_1, radarColors_1, radarFormats_1, radarDataLabels_1, radarSeriesLabelFor_1, radarTooltipFormatter, radarLegend, radarBand, radarPlotWidth, radarPlotHeight, radarGeometry, variant_1, categories, seriesValues, stockFormats_1, stockRoleIndex_1, stockFormatFor_1, stockDataLabels_1, stockSeriesLabelFor_1, upColor_1, downColor_1, volumePoints, hasVolume, stockGrid, baseStockXAxis, stockXAxis, volumeYAxis, volumeSeries, stockAxisPointer, candleData, lineSeries, stockColors_1, isStacked, isCircularChart, isOfPie, ofPieLayout, isHorizontalBarChart, shouldAggregate, primaryDomainSource, rawPrimaryDomainValues, aggregateDomainValues, categoryLevels, pushSeriesOverlays, sideBySideBarCount, specBarGap, specBarCategoryGap, seriesPalette, paletteColorAt, _loop_1, _r, _s, _t, specSeriesIndex, series, e_3_1, labels, seriesEntry, rawValues, _u, main_1, secondary, otherTotal, total, ofPieType_1, secondScale, halfAngle_1, hasSecondary, MAIN_CX_1, CY_1, MAIN_RADIUS_PCT_1, SECONDARY_CX_1, secondaryRadiusPct_1, BAR_LEFT_1, BAR_RIGHT, barHalfFrac_1, ofPiePalette_1, paletteAt_1, connectorColor_1, primaryDomainSource_1, rawDomainValues, labels, seriesEntry, rawValues_1, totalIndices, steps, accent_1, decreaseColor_1, totalColor_1, pointColors_1, _v, _w, dp, connectors, primaryDomainSource_2, rawDomainValues, labels_1, seriesEntry, rawValues, funnelPalette, funnelColor_1, stageColors_1, _x, _y, dp, funnelData, funnelLayout, funnelLabelsOff, quartileMethod_1, showOutliers_1, showMeanMarker_1, showInnerPoints_1, showMeanLine_1, boxDomainSource, boxCategories_2, grouped_1, groups_1, boxCategories_1, boxCategories_1_1, c, boxSeriesSpecs, slots_1, boxGap, boxPlotWidth, boxBand, boxWidthMax_1, boxCount_1, slotX_1, boxLegend_1, rawValues, histogramDomainSource, histogramCategories, _z, labels, counts, isPareto_1, cumulativePercents, pareto, histogramSeries, histogramColor, paretoLineColor, renderedSeriesCount, replaceMerge, valueAxisBase, isPareto, hasSecondaryAxis, isPercentStackedBars, primaryAxisNumberFormat, secondaryAxisNumberFormat, axisNumberFormatFor, seriesNumberFormats, seriesNumberFormatFor, tooltipConfig, finalLegend, bottomAxisNameGap, legendBand, positionedLegend, gridConfig, chartDataLabels, seriesLabelOptionFor, isDoughnut, doughnutHoleSize, doughnutSeriesOrder, doughnutRingSet, explosion, explosionOffset, barSeries, len, categoryTotals_2, barSeries_1, barSeries_1_1, s, i, raw, n, barSeries_2, barSeries_2_1, s, seriesWithLabels;
|
|
432
|
+
var e_1, _0, e_2, _1, e_4, _2, e_5, _3, e_3, _4, e_6, _5, e_7, _6, e_8, _7, e_9, _8, e_10, _9;
|
|
433
|
+
var _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180;
|
|
434
|
+
return tslib_1.__generator(this, function (_181) {
|
|
435
|
+
switch (_181.label) {
|
|
420
436
|
case 0:
|
|
421
437
|
(0, utils_1.debug)("Updating chart", chart);
|
|
422
438
|
threeDRenderKind = (0, three_d_1.resolve3DRenderKind)(spec.sourceChartType);
|
|
@@ -440,7 +456,7 @@ var BasicChart = function (_a) {
|
|
|
440
456
|
// Leaving 3-D (spec edit) — the grid3D option doesn't merge back
|
|
441
457
|
// into a cartesian one, so re-initialize from a clean slate and
|
|
442
458
|
// let the normal 2-D flow below do a full structural render.
|
|
443
|
-
(
|
|
459
|
+
(_10 = chartRef.current) === null || _10 === void 0 ? void 0 : _10.dispose();
|
|
444
460
|
chartRef.current = undefined;
|
|
445
461
|
renderedIn3D.current = false;
|
|
446
462
|
previousChartType.current = undefined;
|
|
@@ -454,7 +470,7 @@ var BasicChart = function (_a) {
|
|
|
454
470
|
// doesn't merge back into a cartesian one, so re-initialize from
|
|
455
471
|
// a clean slate and let the normal flow below do a full
|
|
456
472
|
// structural render.
|
|
457
|
-
(
|
|
473
|
+
(_11 = chartRef.current) === null || _11 === void 0 ? void 0 : _11.dispose();
|
|
458
474
|
chartRef.current = undefined;
|
|
459
475
|
renderedAsRegionMap.current = false;
|
|
460
476
|
previousChartType.current = undefined;
|
|
@@ -467,7 +483,7 @@ var BasicChart = function (_a) {
|
|
|
467
483
|
geoScope = (0, region_map_1.resolveGeoScope)(regionSpec.geoScope);
|
|
468
484
|
return [4 /*yield*/, (0, region_map_loader_1.loadRegionMapGeo)(geoScope)];
|
|
469
485
|
case 1:
|
|
470
|
-
geo =
|
|
486
|
+
geo = _181.sent();
|
|
471
487
|
// Entering the region map from a cartesian render: the previous
|
|
472
488
|
// grid/axis option doesn't merge into the map one, so start from
|
|
473
489
|
// a bare instance (theme options are re-applied after setOption).
|
|
@@ -482,7 +498,7 @@ var BasicChart = function (_a) {
|
|
|
482
498
|
if (!geo) {
|
|
483
499
|
// Map asset failed to load (or unknown scope) — the loader
|
|
484
500
|
// already warned once; render an empty chart, never crash.
|
|
485
|
-
(
|
|
501
|
+
(_12 = chartRef.current) === null || _12 === void 0 ? void 0 : _12.setOption({ series: [] }, { replaceMerge: ["series", "visualMap"] });
|
|
486
502
|
renderedAsRegionMap.current = true;
|
|
487
503
|
applyThemeOptions();
|
|
488
504
|
previousChartType.current = spec.chartType;
|
|
@@ -490,7 +506,7 @@ var BasicChart = function (_a) {
|
|
|
490
506
|
return [2 /*return*/];
|
|
491
507
|
}
|
|
492
508
|
labels = flattenChartDataValues(regionSpec.domains, getDomainValuesFromRange, regionSpec.hiddenDimensionStrategy, false);
|
|
493
|
-
seriesEntry = (
|
|
509
|
+
seriesEntry = (_13 = regionSpec.series) === null || _13 === void 0 ? void 0 : _13[0];
|
|
494
510
|
values = seriesEntry
|
|
495
511
|
? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, regionSpec.hiddenDimensionStrategy)
|
|
496
512
|
: [];
|
|
@@ -506,7 +522,7 @@ var BasicChart = function (_a) {
|
|
|
506
522
|
seriesName = (seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) && !(0, utils_1.isAFormula)(seriesEntry.dataLabel)
|
|
507
523
|
? seriesEntry.dataLabel
|
|
508
524
|
: "";
|
|
509
|
-
(
|
|
525
|
+
(_14 = chartRef.current) === null || _14 === void 0 ? void 0 : _14.setOption({
|
|
510
526
|
// The visualMap color scale is the value legend; the series
|
|
511
527
|
// legend stays hidden unless an authored override turns it on.
|
|
512
528
|
legend: (0, overrides_1.applyLegendOverrides)(tslib_1.__assign(tslib_1.__assign({}, defaultLegendConfig), { show: false }), spec.legend),
|
|
@@ -574,36 +590,36 @@ var BasicChart = function (_a) {
|
|
|
574
590
|
hierarchyTitleRef.current = explicitChartTitle;
|
|
575
591
|
skipHeaders_1 = spec.useFirstRowAsHeaders !== false;
|
|
576
592
|
labelValues = flattenChartDataValues(spec.bubbleLabels, getDomainValuesFromRange, spec.hiddenDimensionStrategy, skipHeaders_1);
|
|
577
|
-
perSeriesX = ((
|
|
593
|
+
perSeriesX = ((_15 = spec.domains) !== null && _15 !== void 0 ? _15 : []).map(function (dom) {
|
|
578
594
|
return flattenChartDataValues([dom], getSeriesValuesFromRange, spec.hiddenDimensionStrategy, skipHeaders_1);
|
|
579
595
|
});
|
|
580
|
-
perSeriesSize = ((
|
|
596
|
+
perSeriesSize = ((_16 = spec.bubbleSizes) !== null && _16 !== void 0 ? _16 : []).map(function (sz) {
|
|
581
597
|
return flattenChartDataValues([sz], getSeriesValuesFromRange, spec.hiddenDimensionStrategy, skipHeaders_1);
|
|
582
598
|
});
|
|
583
599
|
seriesInputs = [];
|
|
584
600
|
i = 0;
|
|
585
|
-
|
|
601
|
+
_181.label = 3;
|
|
586
602
|
case 3:
|
|
587
603
|
if (!(i < spec.series.length)) return [3 /*break*/, 7];
|
|
588
604
|
seriesEntry = spec.series[i];
|
|
589
|
-
resolvedLabel = (
|
|
605
|
+
resolvedLabel = (_17 = seriesEntry.dataLabel) !== null && _17 !== void 0 ? _17 : "";
|
|
590
606
|
if (!(resolvedLabel && (0, utils_1.isAFormula)(resolvedLabel))) return [3 /*break*/, 5];
|
|
591
607
|
_b = chart_spec_utils_1.coerceCalculatedLabel;
|
|
592
|
-
return [4 /*yield*/, onRequestCalculate(resolvedLabel, (
|
|
608
|
+
return [4 /*yield*/, onRequestCalculate(resolvedLabel, (_18 = position.sheetId) !== null && _18 !== void 0 ? _18 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
593
609
|
case 4:
|
|
594
|
-
resolvedLabel = _b.apply(void 0, [
|
|
595
|
-
|
|
610
|
+
resolvedLabel = _b.apply(void 0, [_181.sent()]);
|
|
611
|
+
_181.label = 5;
|
|
596
612
|
case 5:
|
|
597
|
-
xValues = (
|
|
598
|
-
sizeValues_1 = (
|
|
613
|
+
xValues = (_19 = perSeriesX[i]) !== null && _19 !== void 0 ? _19 : perSeriesX[0];
|
|
614
|
+
sizeValues_1 = (_20 = perSeriesSize[i]) !== null && _20 !== void 0 ? _20 : perSeriesSize[0];
|
|
599
615
|
seriesInputs.push(tslib_1.__assign(tslib_1.__assign({ name: resolvedLabel, values: flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy, skipHeaders_1) }, (xValues ? { xValues: xValues } : {})), (sizeValues_1 ? { sizeValues: sizeValues_1 } : {})));
|
|
600
|
-
|
|
616
|
+
_181.label = 6;
|
|
601
617
|
case 6:
|
|
602
618
|
i++;
|
|
603
619
|
return [3 /*break*/, 3];
|
|
604
620
|
case 7:
|
|
605
|
-
sharedXValues = (
|
|
606
|
-
sharedSizeValues = (
|
|
621
|
+
sharedXValues = (_21 = perSeriesX[0]) !== null && _21 !== void 0 ? _21 : [];
|
|
622
|
+
sharedSizeValues = (_22 = perSeriesSize[0]) !== null && _22 !== void 0 ? _22 : [];
|
|
607
623
|
_c = (0, bubble_1.prepareBubbleSeriesData)({
|
|
608
624
|
xValues: sharedXValues,
|
|
609
625
|
labelValues: labelValues,
|
|
@@ -624,7 +640,7 @@ var BasicChart = function (_a) {
|
|
|
624
640
|
theme.themeColors.accent6,
|
|
625
641
|
]);
|
|
626
642
|
bubbleItemColor_1 = function (seriesEntry, index) {
|
|
627
|
-
var
|
|
643
|
+
var e_11, _a;
|
|
628
644
|
var _b, _c;
|
|
629
645
|
var base = (_b = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _b !== void 0 ? _b : (0, utils_1.chartPaletteColorAt)(bubblePalette_1, index);
|
|
630
646
|
var overrides = new Map();
|
|
@@ -636,29 +652,29 @@ var BasicChart = function (_a) {
|
|
|
636
652
|
}
|
|
637
653
|
}
|
|
638
654
|
}
|
|
639
|
-
catch (
|
|
655
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
640
656
|
finally {
|
|
641
657
|
try {
|
|
642
658
|
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
643
659
|
}
|
|
644
|
-
finally { if (
|
|
660
|
+
finally { if (e_11) throw e_11.error; }
|
|
645
661
|
}
|
|
646
662
|
return overrides.size
|
|
647
663
|
? function (params) { var _a, _b; return (_b = overrides.get((_a = params === null || params === void 0 ? void 0 : params.data) === null || _a === void 0 ? void 0 : _a.index)) !== null && _b !== void 0 ? _b : base; }
|
|
648
664
|
: base;
|
|
649
665
|
};
|
|
650
|
-
hasBubbleSecondaryAxis = ((
|
|
666
|
+
hasBubbleSecondaryAxis = ((_23 = spec.series) !== null && _23 !== void 0 ? _23 : []).some(function (seriesEntry) { return seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.useSecondaryAxis; });
|
|
651
667
|
xAxisConfig = categories_1.length > 0
|
|
652
668
|
? {
|
|
653
669
|
type: "category",
|
|
654
670
|
data: categories_1,
|
|
655
|
-
name: (
|
|
671
|
+
name: (_24 = spec.horizontalAxisTitle) !== null && _24 !== void 0 ? _24 : "",
|
|
656
672
|
nameLocation: "middle",
|
|
657
673
|
nameGap: 30,
|
|
658
674
|
}
|
|
659
675
|
: {
|
|
660
676
|
type: "value",
|
|
661
|
-
name: (
|
|
677
|
+
name: (_25 = spec.horizontalAxisTitle) !== null && _25 !== void 0 ? _25 : "",
|
|
662
678
|
nameLocation: "middle",
|
|
663
679
|
nameGap: 30,
|
|
664
680
|
};
|
|
@@ -740,14 +756,29 @@ var BasicChart = function (_a) {
|
|
|
740
756
|
},
|
|
741
757
|
});
|
|
742
758
|
});
|
|
743
|
-
|
|
759
|
+
bubbleLegend = (0, overrides_1.applyLegendOverrides)(tslib_1.__assign(tslib_1.__assign({}, legend), { show: preparedSeries.length > 1, data: preparedSeries.map(function (entry) { return entry.name; }) }), spec.legend);
|
|
760
|
+
bubbleBand = (0, legend_layout_1.reserveEchartsLegendBand)({
|
|
761
|
+
position: (_26 = spec.legend) === null || _26 === void 0 ? void 0 : _26.position,
|
|
762
|
+
visible: bubbleLegend.show !== false,
|
|
763
|
+
labels: preparedSeries.map(function (entry) { return entry.name; }),
|
|
764
|
+
legendFontSize: (_31 = (_28 = (_27 = bubbleLegend.textStyle) === null || _27 === void 0 ? void 0 : _27.fontSize) !== null && _28 !== void 0 ? _28 : (_30 = (_29 = spec.legend) === null || _29 === void 0 ? void 0 : _29.textFormat) === null || _30 === void 0 ? void 0 : _30.fontSize) !== null && _31 !== void 0 ? _31 : 12,
|
|
765
|
+
legendItemWidth: defaultLegendConfig.itemWidth,
|
|
766
|
+
width: width !== null && width !== void 0 ? width : 0,
|
|
767
|
+
height: height !== null && height !== void 0 ? height : 0,
|
|
768
|
+
hasTitle: Boolean(explicitChartTitle),
|
|
769
|
+
titleFontSize: (_33 = (_32 = spec.titleTextFormat) === null || _32 === void 0 ? void 0 : _32.fontSize) !== null && _33 !== void 0 ? _33 : 16,
|
|
770
|
+
hasBottomAxisTitle: Boolean(spec.horizontalAxisTitle),
|
|
771
|
+
bottomAxisNameGap: 30,
|
|
772
|
+
hasLeftAxisTitle: Boolean(spec.verticalAxisTitle),
|
|
773
|
+
});
|
|
774
|
+
(_34 = chartRef.current) === null || _34 === void 0 ? void 0 : _34.setOption({
|
|
744
775
|
xAxis: [
|
|
745
776
|
(0, overrides_1.applyAxisOverrides)(tslib_1.__assign({}, xAxisConfig), spec.categoryAxisOptions),
|
|
746
777
|
],
|
|
747
778
|
yAxis: tslib_1.__spreadArray([
|
|
748
779
|
(0, overrides_1.applyAxisOverrides)({
|
|
749
780
|
type: "value",
|
|
750
|
-
name: (
|
|
781
|
+
name: (_35 = spec.verticalAxisTitle) !== null && _35 !== void 0 ? _35 : "",
|
|
751
782
|
nameLocation: "middle",
|
|
752
783
|
nameGap: 45,
|
|
753
784
|
}, spec.valueAxisOptions, undefined, locale)
|
|
@@ -762,13 +793,10 @@ var BasicChart = function (_a) {
|
|
|
762
793
|
}, spec.secondaryValueAxisOptions, undefined, locale),
|
|
763
794
|
]
|
|
764
795
|
: [])), false),
|
|
765
|
-
legend:
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
bottom: "3%",
|
|
770
|
-
containLabel: true,
|
|
771
|
-
},
|
|
796
|
+
legend: tslib_1.__assign(tslib_1.__assign({}, bubbleLegend), bubbleBand.legend),
|
|
797
|
+
// The plot shrinks to leave the legend its own band, as the
|
|
798
|
+
// category charts do (#1089).
|
|
799
|
+
grid: bubbleBand.grid,
|
|
772
800
|
tooltip: {
|
|
773
801
|
trigger: "item",
|
|
774
802
|
formatter: tooltipFormatter,
|
|
@@ -808,13 +836,13 @@ var BasicChart = function (_a) {
|
|
|
808
836
|
theme.themeColors.accent5,
|
|
809
837
|
theme.themeColors.accent6,
|
|
810
838
|
]);
|
|
811
|
-
hierarchyData = colorHierarchyNodes((0, hierarchy_1.buildHierarchyTree)(hierarchyRows), hierarchyPalette);
|
|
812
|
-
rootName = hierarchyData.length === 1 ? (_34 = (_33 = hierarchyData[0]) === null || _33 === void 0 ? void 0 : _33.name) !== null && _34 !== void 0 ? _34 : "" : "";
|
|
813
|
-
drillDown = Boolean(spec.drillDown);
|
|
814
|
-
seriesDisplayName = (_36 = (_35 = explicitChartTitle !== null && explicitChartTitle !== void 0 ? explicitChartTitle : headerTitle) !== null && _35 !== void 0 ? _35 : rootName) !== null && _36 !== void 0 ? _36 : "";
|
|
815
|
-
hierarchyDepth = getHierarchyDepth(hierarchyData);
|
|
816
839
|
isTreemap = spec.chartType === "treemap";
|
|
817
840
|
banner = isTreemap && treemapBannerShown(spec.parentLabelLayout);
|
|
841
|
+
hierarchyData = colorHierarchyNodes((0, hierarchy_1.buildHierarchyTree)(hierarchyRows), hierarchyPalette, { banner: banner });
|
|
842
|
+
rootName = hierarchyData.length === 1 ? (_37 = (_36 = hierarchyData[0]) === null || _36 === void 0 ? void 0 : _36.name) !== null && _37 !== void 0 ? _37 : "" : "";
|
|
843
|
+
drillDown = Boolean(spec.drillDown);
|
|
844
|
+
seriesDisplayName = (_39 = (_38 = explicitChartTitle !== null && explicitChartTitle !== void 0 ? explicitChartTitle : headerTitle) !== null && _38 !== void 0 ? _38 : rootName) !== null && _39 !== void 0 ? _39 : "";
|
|
845
|
+
hierarchyDepth = getHierarchyDepth(hierarchyData);
|
|
818
846
|
levels = buildHierarchyLevels(hierarchyDepth, {
|
|
819
847
|
treemap: isTreemap,
|
|
820
848
|
banner: banner,
|
|
@@ -835,7 +863,7 @@ var BasicChart = function (_a) {
|
|
|
835
863
|
});
|
|
836
864
|
})
|
|
837
865
|
: [];
|
|
838
|
-
sizeNumberFormat_1 = (0, axis_number_format_1.resolveSourceNumberFormat)((
|
|
866
|
+
sizeNumberFormat_1 = (0, axis_number_format_1.resolveSourceNumberFormat)((_41 = (_40 = spec.sizeData) === null || _40 === void 0 ? void 0 : _40[0]) === null || _41 === void 0 ? void 0 : _41.sources, getFormattingFromRange, spec.hiddenDimensionStrategy);
|
|
839
867
|
tooltipFormatter = function (params) {
|
|
840
868
|
var _a;
|
|
841
869
|
var value = Array.isArray(params.value)
|
|
@@ -844,9 +872,27 @@ var BasicChart = function (_a) {
|
|
|
844
872
|
return "".concat(params.name, ": ").concat((0, axis_number_format_1.formatAxisValue)(sizeNumberFormat_1, value, locale));
|
|
845
873
|
};
|
|
846
874
|
hierarchyDataLabels = spec.dataLabels;
|
|
847
|
-
|
|
848
|
-
? tslib_1.__assign(tslib_1.__assign({}, hierarchyDataLabels), { numberFormatPattern: sizeNumberFormat_1 }) : hierarchyDataLabels
|
|
849
|
-
|
|
875
|
+
hierarchyLabelOpts = hierarchyDataLabels && !hierarchyDataLabels.numberFormatPattern
|
|
876
|
+
? tslib_1.__assign(tslib_1.__assign({}, hierarchyDataLabels), { numberFormatPattern: sizeNumberFormat_1 }) : hierarchyDataLabels;
|
|
877
|
+
hierarchyLabel = (hierarchyLabelOpts === null || hierarchyLabelOpts === void 0 ? void 0 : hierarchyLabelOpts.show) === false
|
|
878
|
+
? { show: false }
|
|
879
|
+
: (hierarchyLabelOpts === null || hierarchyLabelOpts === void 0 ? void 0 : hierarchyLabelOpts.show)
|
|
880
|
+
? tslib_1.__assign({ show: true, formatter: (0, overrides_1.dataLabelFormatter)(hierarchyLabelOpts, locale, isTreemap ? "\n" : ": ") }, (isTreemap ? { position: "insideBottomLeft" } : {})) : tslib_1.__assign({ show: true, formatter: "{b}" }, (isTreemap ? { position: "insideBottomLeft" } : {}));
|
|
881
|
+
hierarchyBand = (0, legend_layout_1.reserveEchartsLegendBand)({
|
|
882
|
+
position: (_42 = spec.legend) === null || _42 === void 0 ? void 0 : _42.position,
|
|
883
|
+
visible: legendShown && hierarchyData.length > 0,
|
|
884
|
+
labels: hierarchyData.map(function (node) { return node.name; }),
|
|
885
|
+
legendFontSize: (_47 = (_44 = (_43 = hierarchyLegend.textStyle) === null || _43 === void 0 ? void 0 : _43.fontSize) !== null && _44 !== void 0 ? _44 : (_46 = (_45 = spec.legend) === null || _45 === void 0 ? void 0 : _45.textFormat) === null || _46 === void 0 ? void 0 : _46.fontSize) !== null && _47 !== void 0 ? _47 : 12,
|
|
886
|
+
legendItemWidth: defaultLegendConfig.itemWidth,
|
|
887
|
+
width: width !== null && width !== void 0 ? width : 0,
|
|
888
|
+
height: height !== null && height !== void 0 ? height : 0,
|
|
889
|
+
hasTitle: Boolean(explicitChartTitle !== null && explicitChartTitle !== void 0 ? explicitChartTitle : headerTitle),
|
|
890
|
+
titleFontSize: (_49 = (_48 = spec.titleTextFormat) === null || _48 === void 0 ? void 0 : _48.fontSize) !== null && _49 !== void 0 ? _49 : 16,
|
|
891
|
+
hasBottomAxisTitle: false,
|
|
892
|
+
bottomAxisNameGap: 0,
|
|
893
|
+
hasLeftAxisTitle: false,
|
|
894
|
+
});
|
|
895
|
+
(_50 = chartRef.current) === null || _50 === void 0 ? void 0 : _50.setOption({
|
|
850
896
|
xAxis: [
|
|
851
897
|
{
|
|
852
898
|
type: "category",
|
|
@@ -859,7 +905,7 @@ var BasicChart = function (_a) {
|
|
|
859
905
|
show: false,
|
|
860
906
|
},
|
|
861
907
|
],
|
|
862
|
-
legend: tslib_1.__assign(tslib_1.__assign({}, hierarchyLegend), { data: hierarchyData.map(function (node) { return node.name; }), selectedMode: false }),
|
|
908
|
+
legend: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, hierarchyLegend), hierarchyBand.legend), { data: hierarchyData.map(function (node) { return node.name; }), selectedMode: false }),
|
|
863
909
|
grid: {
|
|
864
910
|
left: 0,
|
|
865
911
|
right: 0,
|
|
@@ -871,17 +917,27 @@ var BasicChart = function (_a) {
|
|
|
871
917
|
formatter: tooltipFormatter,
|
|
872
918
|
},
|
|
873
919
|
series: tslib_1.__spreadArray([
|
|
874
|
-
tslib_1.__assign({ type: chartType, name: seriesDisplayName, rootName: rootName || seriesDisplayName || "", data: hierarchyData, label:
|
|
920
|
+
tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ type: chartType, name: seriesDisplayName, rootName: rootName || seriesDisplayName || "", data: hierarchyData, label: hierarchyLabel,
|
|
875
921
|
// Only `levels[1]` (the categories) may carry a banner; see
|
|
876
922
|
// buildHierarchyLevels.
|
|
877
|
-
upperLabel: isTreemap ? { show: false } : undefined, levels: levels,
|
|
923
|
+
upperLabel: isTreemap ? { show: false } : undefined, levels: levels }, (isTreemap
|
|
924
|
+
? {
|
|
925
|
+
// Excel has no wheel zoom / drag pan on a treemap; the
|
|
926
|
+
// sheet keeps scrolling under the pointer (#1086).
|
|
927
|
+
roam: drillDown,
|
|
928
|
+
left: hierarchyBand.grid.left,
|
|
929
|
+
right: hierarchyBand.grid.right,
|
|
930
|
+
top: hierarchyBand.grid.top,
|
|
931
|
+
bottom: hierarchyBand.grid.bottom,
|
|
932
|
+
}
|
|
933
|
+
: {})), {
|
|
878
934
|
// Excel has no drill-down on either chart: zooming into a
|
|
879
935
|
// branch on click (and the treemap breadcrumb) is opt-in.
|
|
880
936
|
nodeClick: drillDown
|
|
881
937
|
? spec.chartType === "treemap"
|
|
882
938
|
? "zoomToNode"
|
|
883
939
|
: "rootToNode"
|
|
884
|
-
: false }, (isTreemap
|
|
940
|
+
: false }), (isTreemap
|
|
885
941
|
? { breadcrumb: { show: drillDown } }
|
|
886
942
|
: { radius: tslib_1.__spreadArray([], tslib_1.__read(SUNBURST_RADIUS), false) }))
|
|
887
943
|
], tslib_1.__read(categoryLegendSeries), false),
|
|
@@ -908,7 +964,7 @@ var BasicChart = function (_a) {
|
|
|
908
964
|
}
|
|
909
965
|
isContour = (0, three_d_1.isContourSpec)(spec);
|
|
910
966
|
if (renderedAsContour.current && !isContour) {
|
|
911
|
-
(
|
|
967
|
+
(_51 = chartRef.current) === null || _51 === void 0 ? void 0 : _51.dispose();
|
|
912
968
|
chartRef.current = undefined;
|
|
913
969
|
renderedAsContour.current = false;
|
|
914
970
|
previousChartType.current = undefined;
|
|
@@ -919,39 +975,39 @@ var BasicChart = function (_a) {
|
|
|
919
975
|
if (!isContour) return [3 /*break*/, 19];
|
|
920
976
|
categories_2 = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
921
977
|
contourSeriesInputs = [];
|
|
922
|
-
|
|
978
|
+
_181.label = 9;
|
|
923
979
|
case 9:
|
|
924
|
-
|
|
925
|
-
_d = tslib_1.__values((
|
|
926
|
-
|
|
980
|
+
_181.trys.push([9, 16, 17, 18]);
|
|
981
|
+
_d = tslib_1.__values((_52 = spec.series) !== null && _52 !== void 0 ? _52 : []), _e = _d.next();
|
|
982
|
+
_181.label = 10;
|
|
927
983
|
case 10:
|
|
928
984
|
if (!!_e.done) return [3 /*break*/, 15];
|
|
929
985
|
seriesEntry = _e.value;
|
|
930
986
|
if (!(!(0, utils_1.isNil)(seriesEntry.dataLabel) && (0, utils_1.isAFormula)(seriesEntry.dataLabel))) return [3 /*break*/, 12];
|
|
931
987
|
_g = chart_spec_utils_1.coerceCalculatedLabel;
|
|
932
|
-
return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (
|
|
988
|
+
return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_53 = position.sheetId) !== null && _53 !== void 0 ? _53 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
933
989
|
case 11:
|
|
934
|
-
_f = _g.apply(void 0, [
|
|
990
|
+
_f = _g.apply(void 0, [_181.sent()]);
|
|
935
991
|
return [3 /*break*/, 13];
|
|
936
992
|
case 12:
|
|
937
|
-
_f = (
|
|
938
|
-
|
|
993
|
+
_f = (_54 = seriesEntry.dataLabel) !== null && _54 !== void 0 ? _54 : "";
|
|
994
|
+
_181.label = 13;
|
|
939
995
|
case 13:
|
|
940
996
|
dataLabel = _f;
|
|
941
997
|
values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(sanitizeChartValue);
|
|
942
998
|
contourSeriesInputs.push({ name: dataLabel, values: values });
|
|
943
|
-
|
|
999
|
+
_181.label = 14;
|
|
944
1000
|
case 14:
|
|
945
1001
|
_e = _d.next();
|
|
946
1002
|
return [3 /*break*/, 10];
|
|
947
1003
|
case 15: return [3 /*break*/, 18];
|
|
948
1004
|
case 16:
|
|
949
|
-
e_1_1 =
|
|
1005
|
+
e_1_1 = _181.sent();
|
|
950
1006
|
e_1 = { error: e_1_1 };
|
|
951
1007
|
return [3 /*break*/, 18];
|
|
952
1008
|
case 17:
|
|
953
1009
|
try {
|
|
954
|
-
if (_e && !_e.done && (
|
|
1010
|
+
if (_e && !_e.done && (_0 = _d.return)) _0.call(_d);
|
|
955
1011
|
}
|
|
956
1012
|
finally { if (e_1) throw e_1.error; }
|
|
957
1013
|
return [7 /*endfinally*/];
|
|
@@ -971,7 +1027,7 @@ var BasicChart = function (_a) {
|
|
|
971
1027
|
chartRef.current = echarts.init(el.current);
|
|
972
1028
|
bindSeriesSelection(chartRef.current);
|
|
973
1029
|
}
|
|
974
|
-
(
|
|
1030
|
+
(_55 = chartRef.current) === null || _55 === void 0 ? void 0 : _55.setOption({
|
|
975
1031
|
tooltip: {
|
|
976
1032
|
textStyle: { fontSize: 12 },
|
|
977
1033
|
trigger: "item",
|
|
@@ -991,7 +1047,7 @@ var BasicChart = function (_a) {
|
|
|
991
1047
|
type: "category",
|
|
992
1048
|
data: categories_2,
|
|
993
1049
|
splitArea: { show: true },
|
|
994
|
-
name: (
|
|
1050
|
+
name: (_56 = spec.horizontalAxisTitle) !== null && _56 !== void 0 ? _56 : "",
|
|
995
1051
|
nameLocation: "middle",
|
|
996
1052
|
nameGap: 30,
|
|
997
1053
|
}, spec.categoryAxisOptions),
|
|
@@ -1001,7 +1057,7 @@ var BasicChart = function (_a) {
|
|
|
1001
1057
|
type: "category",
|
|
1002
1058
|
data: seriesNames_1,
|
|
1003
1059
|
splitArea: { show: true },
|
|
1004
|
-
name: (
|
|
1060
|
+
name: (_57 = spec.verticalAxisTitle) !== null && _57 !== void 0 ? _57 : "",
|
|
1005
1061
|
nameLocation: "middle",
|
|
1006
1062
|
nameGap: 50,
|
|
1007
1063
|
},
|
|
@@ -1054,39 +1110,39 @@ var BasicChart = function (_a) {
|
|
|
1054
1110
|
if (!(willRender3D && threeDRenderKind)) return [3 /*break*/, 30];
|
|
1055
1111
|
categories_3 = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
1056
1112
|
threeDSeriesInputs = [];
|
|
1057
|
-
|
|
1113
|
+
_181.label = 20;
|
|
1058
1114
|
case 20:
|
|
1059
|
-
|
|
1060
|
-
_j = tslib_1.__values((
|
|
1061
|
-
|
|
1115
|
+
_181.trys.push([20, 27, 28, 29]);
|
|
1116
|
+
_j = tslib_1.__values((_58 = spec.series) !== null && _58 !== void 0 ? _58 : []), _k = _j.next();
|
|
1117
|
+
_181.label = 21;
|
|
1062
1118
|
case 21:
|
|
1063
1119
|
if (!!_k.done) return [3 /*break*/, 26];
|
|
1064
1120
|
seriesEntry = _k.value;
|
|
1065
1121
|
if (!(!(0, utils_1.isNil)(seriesEntry.dataLabel) && (0, utils_1.isAFormula)(seriesEntry.dataLabel))) return [3 /*break*/, 23];
|
|
1066
1122
|
_m = chart_spec_utils_1.coerceCalculatedLabel;
|
|
1067
|
-
return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (
|
|
1123
|
+
return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_59 = position.sheetId) !== null && _59 !== void 0 ? _59 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
1068
1124
|
case 22:
|
|
1069
|
-
_l = _m.apply(void 0, [
|
|
1125
|
+
_l = _m.apply(void 0, [_181.sent()]);
|
|
1070
1126
|
return [3 /*break*/, 24];
|
|
1071
1127
|
case 23:
|
|
1072
|
-
_l = (
|
|
1073
|
-
|
|
1128
|
+
_l = (_60 = seriesEntry.dataLabel) !== null && _60 !== void 0 ? _60 : "";
|
|
1129
|
+
_181.label = 24;
|
|
1074
1130
|
case 24:
|
|
1075
1131
|
dataLabel = _l;
|
|
1076
1132
|
values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(sanitizeChartValue);
|
|
1077
1133
|
threeDSeriesInputs.push({ name: dataLabel, values: values });
|
|
1078
|
-
|
|
1134
|
+
_181.label = 25;
|
|
1079
1135
|
case 25:
|
|
1080
1136
|
_k = _j.next();
|
|
1081
1137
|
return [3 /*break*/, 21];
|
|
1082
1138
|
case 26: return [3 /*break*/, 29];
|
|
1083
1139
|
case 27:
|
|
1084
|
-
e_2_1 =
|
|
1140
|
+
e_2_1 = _181.sent();
|
|
1085
1141
|
e_2 = { error: e_2_1 };
|
|
1086
1142
|
return [3 /*break*/, 29];
|
|
1087
1143
|
case 28:
|
|
1088
1144
|
try {
|
|
1089
|
-
if (_k && !_k.done && (
|
|
1145
|
+
if (_k && !_k.done && (_1 = _j.return)) _1.call(_j);
|
|
1090
1146
|
}
|
|
1091
1147
|
finally { if (e_2) throw e_2.error; }
|
|
1092
1148
|
return [7 /*endfinally*/];
|
|
@@ -1160,7 +1216,7 @@ var BasicChart = function (_a) {
|
|
|
1160
1216
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1161
1217
|
finally {
|
|
1162
1218
|
try {
|
|
1163
|
-
if (threeDSeriesInputs_1_1 && !threeDSeriesInputs_1_1.done && (
|
|
1219
|
+
if (threeDSeriesInputs_1_1 && !threeDSeriesInputs_1_1.done && (_2 = threeDSeriesInputs_1.return)) _2.call(threeDSeriesInputs_1);
|
|
1164
1220
|
}
|
|
1165
1221
|
finally { if (e_4) throw e_4.error; }
|
|
1166
1222
|
}
|
|
@@ -1250,12 +1306,12 @@ var BasicChart = function (_a) {
|
|
|
1250
1306
|
inRange: { color: tslib_1.__spreadArray([], tslib_1.__read(three_d_1.SURFACE_COLOR_RAMP), false) },
|
|
1251
1307
|
};
|
|
1252
1308
|
}
|
|
1253
|
-
(
|
|
1309
|
+
(_61 = chartRef.current) === null || _61 === void 0 ? void 0 : _61.setOption(tslib_1.__assign(tslib_1.__assign({ tooltip: {
|
|
1254
1310
|
textStyle: { fontSize: 12 },
|
|
1255
1311
|
formatter: threeDTooltipFormatter,
|
|
1256
1312
|
}, legend: threeDRenderKind === "line3D" || stackedBar3D_1
|
|
1257
1313
|
? (0, overrides_1.applyLegendOverrides)(tslib_1.__assign(tslib_1.__assign({}, defaultLegendConfig), { show: seriesNames_2.length > 1, data: seriesNames_2 }), spec.legend)
|
|
1258
|
-
: { show: false }, xAxis3D: tslib_1.__assign(tslib_1.__assign({}, xAxis3D), { name: (
|
|
1314
|
+
: { show: false }, xAxis3D: tslib_1.__assign(tslib_1.__assign({}, xAxis3D), { name: (_62 = spec.horizontalAxisTitle) !== null && _62 !== void 0 ? _62 : "" }), yAxis3D: tslib_1.__assign(tslib_1.__assign({}, yAxis3D), { name: "" }), zAxis3D: { type: "value", name: (_63 = spec.verticalAxisTitle) !== null && _63 !== void 0 ? _63 : "" }, grid3D: {
|
|
1259
1315
|
boxDepth: Math.max(20, Math.min(100, seriesNames_2.length * 20)),
|
|
1260
1316
|
viewControl: { autoRotate: false },
|
|
1261
1317
|
} }, (visualMap ? { visualMap: [visualMap] } : {})), { series: threeDSeries }), {
|
|
@@ -1286,7 +1342,7 @@ var BasicChart = function (_a) {
|
|
|
1286
1342
|
categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, skipHeaders);
|
|
1287
1343
|
radarSeriesInputs = [];
|
|
1288
1344
|
try {
|
|
1289
|
-
for (_p = tslib_1.__values((
|
|
1345
|
+
for (_p = tslib_1.__values((_64 = spec.series) !== null && _64 !== void 0 ? _64 : []), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
1290
1346
|
seriesEntry = _q.value;
|
|
1291
1347
|
label = seriesEntry.dataLabel && !(0, utils_1.isAFormula)(seriesEntry.dataLabel)
|
|
1292
1348
|
? seriesEntry.dataLabel
|
|
@@ -1298,14 +1354,14 @@ var BasicChart = function (_a) {
|
|
|
1298
1354
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1299
1355
|
finally {
|
|
1300
1356
|
try {
|
|
1301
|
-
if (_q && !_q.done && (
|
|
1357
|
+
if (_q && !_q.done && (_3 = _p.return)) _3.call(_p);
|
|
1302
1358
|
}
|
|
1303
1359
|
finally { if (e_5) throw e_5.error; }
|
|
1304
1360
|
}
|
|
1305
1361
|
radarAxisOptions_1 = spec.valueAxisOptions;
|
|
1306
1362
|
indicators_1 = (0, radar_1.buildRadarIndicators)(categories, radarSeriesInputs, radarAxisOptions_1);
|
|
1307
1363
|
radarData = (0, radar_1.buildRadarSeriesData)(radarSeriesInputs, indicators_1.length);
|
|
1308
|
-
radarStyle_1 = (
|
|
1364
|
+
radarStyle_1 = (_65 = spec.radarStyle) !== null && _65 !== void 0 ? _65 : "standard";
|
|
1309
1365
|
radarColors_1 = radarSeriesInputs.map(function (_, i) { var _a, _b; return (_b = (_a = spec.series) === null || _a === void 0 ? void 0 : _a[i]) === null || _b === void 0 ? void 0 : _b.color; });
|
|
1310
1366
|
radarFormats_1 = (0, axis_number_format_1.resolveSeriesNumberFormats)(spec.series, getFormattingFromRange, spec.hiddenDimensionStrategy);
|
|
1311
1367
|
radarDataLabels_1 = spec.dataLabels;
|
|
@@ -1322,8 +1378,34 @@ var BasicChart = function (_a) {
|
|
|
1322
1378
|
});
|
|
1323
1379
|
return tslib_1.__spreadArray([(_b = params === null || params === void 0 ? void 0 : params.name) !== null && _b !== void 0 ? _b : ""], tslib_1.__read(lines), false).filter(Boolean).join("<br/>");
|
|
1324
1380
|
};
|
|
1325
|
-
|
|
1326
|
-
|
|
1381
|
+
radarLegend = (0, overrides_1.applyLegendOverrides)(tslib_1.__assign(tslib_1.__assign({}, legend), { show: radarData.length > 1, data: radarData.map(function (d) { return d.name; }) }), spec.legend);
|
|
1382
|
+
radarBand = (0, legend_layout_1.reserveEchartsLegendBand)({
|
|
1383
|
+
position: (_66 = spec.legend) === null || _66 === void 0 ? void 0 : _66.position,
|
|
1384
|
+
visible: radarLegend.show !== false,
|
|
1385
|
+
labels: radarData.map(function (d) { return d.name; }),
|
|
1386
|
+
legendFontSize: (_71 = (_68 = (_67 = radarLegend.textStyle) === null || _67 === void 0 ? void 0 : _67.fontSize) !== null && _68 !== void 0 ? _68 : (_70 = (_69 = spec.legend) === null || _69 === void 0 ? void 0 : _69.textFormat) === null || _70 === void 0 ? void 0 : _70.fontSize) !== null && _71 !== void 0 ? _71 : 12,
|
|
1387
|
+
legendItemWidth: defaultLegendConfig.itemWidth,
|
|
1388
|
+
width: width !== null && width !== void 0 ? width : 0,
|
|
1389
|
+
height: height !== null && height !== void 0 ? height : 0,
|
|
1390
|
+
hasTitle: Boolean(explicitChartTitle),
|
|
1391
|
+
titleFontSize: (_73 = (_72 = spec.titleTextFormat) === null || _72 === void 0 ? void 0 : _72.fontSize) !== null && _73 !== void 0 ? _73 : 16,
|
|
1392
|
+
hasBottomAxisTitle: false,
|
|
1393
|
+
bottomAxisNameGap: 0,
|
|
1394
|
+
hasLeftAxisTitle: false,
|
|
1395
|
+
});
|
|
1396
|
+
radarPlotWidth = Math.max(0, (width !== null && width !== void 0 ? width : 0) - radarBand.grid.left - radarBand.grid.right);
|
|
1397
|
+
radarPlotHeight = Math.max(0, (height !== null && height !== void 0 ? height : 0) - radarBand.grid.top - radarBand.grid.bottom);
|
|
1398
|
+
radarGeometry = radarPlotWidth > 0 && radarPlotHeight > 0
|
|
1399
|
+
? {
|
|
1400
|
+
center: [
|
|
1401
|
+
radarBand.grid.left + radarPlotWidth / 2,
|
|
1402
|
+
radarBand.grid.top + radarPlotHeight / 2,
|
|
1403
|
+
],
|
|
1404
|
+
radius: Math.max(10, Math.min(radarPlotWidth, radarPlotHeight) / 2 - 30),
|
|
1405
|
+
}
|
|
1406
|
+
: {};
|
|
1407
|
+
(_74 = chartRef.current) === null || _74 === void 0 ? void 0 : _74.setOption({
|
|
1408
|
+
radar: tslib_1.__assign(tslib_1.__assign({}, radarGeometry), {
|
|
1327
1409
|
// The common scale's tick labels along ONE axis, as Excel draws
|
|
1328
1410
|
// them: echarts labels every indicator axis, so each indicator
|
|
1329
1411
|
// carries its own `axisLabel.show` (an indicator's own options win
|
|
@@ -1333,15 +1415,13 @@ var BasicChart = function (_a) {
|
|
|
1333
1415
|
? indicators_1
|
|
1334
1416
|
: [{ name: "", min: 0, max: 1 }]).map(function (indicator, index) { return (tslib_1.__assign(tslib_1.__assign({}, indicator), { axisLabel: {
|
|
1335
1417
|
show: index === 0 && (radarAxisOptions_1 === null || radarAxisOptions_1 === void 0 ? void 0 : radarAxisOptions_1.visible) !== false,
|
|
1336
|
-
} })); }),
|
|
1337
|
-
axisLabel: {
|
|
1418
|
+
} })); }), axisLabel: {
|
|
1338
1419
|
show: (radarAxisOptions_1 === null || radarAxisOptions_1 === void 0 ? void 0 : radarAxisOptions_1.visible) !== false,
|
|
1339
1420
|
formatter: function (value) {
|
|
1340
1421
|
return (0, axis_number_format_1.formatAxisValue)(radarFormats_1[0], value, locale);
|
|
1341
1422
|
},
|
|
1342
|
-
},
|
|
1343
|
-
},
|
|
1344
|
-
legend: (0, overrides_1.applyLegendOverrides)(tslib_1.__assign(tslib_1.__assign({}, legend), { show: radarData.length > 1, data: radarData.map(function (d) { return d.name; }) }), spec.legend),
|
|
1423
|
+
} }),
|
|
1424
|
+
legend: tslib_1.__assign(tslib_1.__assign({}, radarLegend), radarBand.legend),
|
|
1345
1425
|
tooltip: { trigger: "item", formatter: radarTooltipFormatter },
|
|
1346
1426
|
series: [
|
|
1347
1427
|
{
|
|
@@ -1378,9 +1458,9 @@ var BasicChart = function (_a) {
|
|
|
1378
1458
|
// V-variants additionally get a volume column sub-pane below the
|
|
1379
1459
|
// price plot.
|
|
1380
1460
|
if (spec.chartType === "stock") {
|
|
1381
|
-
variant_1 = ((
|
|
1461
|
+
variant_1 = ((_75 = spec.stockVariant) !== null && _75 !== void 0 ? _75 : "HLC");
|
|
1382
1462
|
categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
1383
|
-
seriesValues = ((
|
|
1463
|
+
seriesValues = ((_76 = spec.series) !== null && _76 !== void 0 ? _76 : []).map(function (seriesEntry) {
|
|
1384
1464
|
return flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
|
|
1385
1465
|
});
|
|
1386
1466
|
stockFormats_1 = (0, axis_number_format_1.resolveSeriesNumberFormats)(spec.series, getFormattingFromRange, spec.hiddenDimensionStrategy);
|
|
@@ -1398,7 +1478,7 @@ var BasicChart = function (_a) {
|
|
|
1398
1478
|
upColor_1 = theme.themeColors.accent1;
|
|
1399
1479
|
downColor_1 = theme.themeColors.accent2;
|
|
1400
1480
|
volumePoints = (0, stock_1.toVolumeSeries)(seriesValues, variant_1);
|
|
1401
|
-
hasVolume = ((
|
|
1481
|
+
hasVolume = ((_77 = volumePoints === null || volumePoints === void 0 ? void 0 : volumePoints.length) !== null && _77 !== void 0 ? _77 : 0) > 0;
|
|
1402
1482
|
stockGrid = hasVolume
|
|
1403
1483
|
? [
|
|
1404
1484
|
{ left: "10%", right: "4%", top: "8%", height: "56%" },
|
|
@@ -1412,7 +1492,7 @@ var BasicChart = function (_a) {
|
|
|
1412
1492
|
axisLine: { show: true },
|
|
1413
1493
|
axisTick: { show: true },
|
|
1414
1494
|
splitLine: { show: false },
|
|
1415
|
-
name: (
|
|
1495
|
+
name: (_78 = spec.horizontalAxisTitle) !== null && _78 !== void 0 ? _78 : "",
|
|
1416
1496
|
nameLocation: "middle",
|
|
1417
1497
|
nameGap: 30,
|
|
1418
1498
|
}, spec.categoryAxisOptions);
|
|
@@ -1454,14 +1534,14 @@ var BasicChart = function (_a) {
|
|
|
1454
1534
|
// (no open) fall through to the line-derived rendering below.
|
|
1455
1535
|
if (variant_1 === "OHLC" || variant_1 === "VOHLC") {
|
|
1456
1536
|
candleData = (0, stock_1.toCandlestick)(seriesValues, variant_1);
|
|
1457
|
-
(
|
|
1537
|
+
(_79 = chartRef.current) === null || _79 === void 0 ? void 0 : _79.setOption({
|
|
1458
1538
|
xAxis: stockXAxis,
|
|
1459
1539
|
yAxis: tslib_1.__spreadArray([
|
|
1460
1540
|
(0, overrides_1.applyAxisOverrides)({
|
|
1461
1541
|
type: "value",
|
|
1462
1542
|
show: true,
|
|
1463
1543
|
scale: true,
|
|
1464
|
-
name: (
|
|
1544
|
+
name: (_80 = spec.verticalAxisTitle) !== null && _80 !== void 0 ? _80 : "",
|
|
1465
1545
|
nameLocation: "middle",
|
|
1466
1546
|
nameGap: 50,
|
|
1467
1547
|
gridIndex: 0,
|
|
@@ -1506,13 +1586,13 @@ var BasicChart = function (_a) {
|
|
|
1506
1586
|
theme.themeColors.accent3,
|
|
1507
1587
|
theme.themeColors.accent4,
|
|
1508
1588
|
]);
|
|
1509
|
-
(
|
|
1589
|
+
(_81 = chartRef.current) === null || _81 === void 0 ? void 0 : _81.setOption({
|
|
1510
1590
|
xAxis: stockXAxis,
|
|
1511
1591
|
yAxis: tslib_1.__spreadArray([
|
|
1512
1592
|
(0, overrides_1.applyAxisOverrides)({
|
|
1513
1593
|
type: "value",
|
|
1514
1594
|
show: true,
|
|
1515
|
-
name: (
|
|
1595
|
+
name: (_82 = spec.verticalAxisTitle) !== null && _82 !== void 0 ? _82 : "",
|
|
1516
1596
|
nameLocation: "middle",
|
|
1517
1597
|
nameGap: 50,
|
|
1518
1598
|
gridIndex: 0,
|
|
@@ -1551,14 +1631,14 @@ var BasicChart = function (_a) {
|
|
|
1551
1631
|
ofPieLayout = null;
|
|
1552
1632
|
isHorizontalBarChart = spec.chartType === "bar";
|
|
1553
1633
|
shouldAggregate = (0, aggregation_1.shouldAggregateSeries)(spec.series);
|
|
1554
|
-
primaryDomainSource = (
|
|
1634
|
+
primaryDomainSource = (_85 = (_84 = (_83 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _83 === void 0 ? void 0 : _83[0]) === null || _84 === void 0 ? void 0 : _84.sources) === null || _85 === void 0 ? void 0 : _85[0];
|
|
1555
1635
|
rawPrimaryDomainValues = primaryDomainSource
|
|
1556
|
-
? (0, aggregation_1.sanitizeDomainValues)((
|
|
1636
|
+
? (0, aggregation_1.sanitizeDomainValues)((_86 = getDomainValuesFromRange(primaryDomainSource, spec.hiddenDimensionStrategy)) !== null && _86 !== void 0 ? _86 : [])
|
|
1557
1637
|
: [];
|
|
1558
1638
|
aggregateDomainValues = (0, aggregation_1.getDomainValuesForAxis)(rawPrimaryDomainValues, shouldAggregate);
|
|
1559
1639
|
categoryLevels = isCircularChart
|
|
1560
1640
|
? undefined
|
|
1561
|
-
: (0, category_levels_1.resolveCategoryLevels)((
|
|
1641
|
+
: (0, category_levels_1.resolveCategoryLevels)((_87 = spec.categoryLevels) === null || _87 === void 0 ? void 0 : _87.map(function (level) {
|
|
1562
1642
|
return flattenChartDataValues([level], getDomainValuesFromRange, spec.hiddenDimensionStrategy, false);
|
|
1563
1643
|
}));
|
|
1564
1644
|
if (categoryLevels) {
|
|
@@ -1569,15 +1649,15 @@ var BasicChart = function (_a) {
|
|
|
1569
1649
|
axisTick: { show: true },
|
|
1570
1650
|
splitLine: { show: true },
|
|
1571
1651
|
name: isHorizontalBarChart
|
|
1572
|
-
? (
|
|
1573
|
-
: (
|
|
1652
|
+
? (_88 = spec.verticalAxisTitle) !== null && _88 !== void 0 ? _88 : ""
|
|
1653
|
+
: (_89 = spec.horizontalAxisTitle) !== null && _89 !== void 0 ? _89 : "",
|
|
1574
1654
|
nameLocation: "middle",
|
|
1575
1655
|
nameGap: CATEGORY_AXIS_NAME_GAP + 24 * categoryLevels.outer.length,
|
|
1576
1656
|
})), false));
|
|
1577
1657
|
}
|
|
1578
1658
|
// One category axis per domain (Excel): a domain drawn from several
|
|
1579
1659
|
// ranges lists their categories in sequence on that single axis.
|
|
1580
|
-
(categoryLevels ? [] : (
|
|
1660
|
+
(categoryLevels ? [] : (_90 = spec.domains) !== null && _90 !== void 0 ? _90 : []).forEach(function (domain, domainIndex) {
|
|
1581
1661
|
var _a, _b;
|
|
1582
1662
|
var axisData = domain.sources.flatMap(function (sheetRange, sourceIndex) {
|
|
1583
1663
|
var _a;
|
|
@@ -1613,8 +1693,8 @@ var BasicChart = function (_a) {
|
|
|
1613
1693
|
splitLine: { show: true },
|
|
1614
1694
|
gridIndex: 0,
|
|
1615
1695
|
name: isHorizontalBarChart
|
|
1616
|
-
? (
|
|
1617
|
-
: (
|
|
1696
|
+
? (_91 = spec.verticalAxisTitle) !== null && _91 !== void 0 ? _91 : ""
|
|
1697
|
+
: (_92 = spec.horizontalAxisTitle) !== null && _92 !== void 0 ? _92 : "",
|
|
1618
1698
|
nameLocation: "middle",
|
|
1619
1699
|
nameGap: CATEGORY_AXIS_NAME_GAP,
|
|
1620
1700
|
});
|
|
@@ -1646,7 +1726,7 @@ var BasicChart = function (_a) {
|
|
|
1646
1726
|
};
|
|
1647
1727
|
sideBySideBarCount = isStacked
|
|
1648
1728
|
? 1
|
|
1649
|
-
: ((
|
|
1729
|
+
: ((_93 = spec.series) !== null && _93 !== void 0 ? _93 : []).reduce(function (count, s) {
|
|
1650
1730
|
var _a;
|
|
1651
1731
|
var seriesType = (_a = s.seriesChartType) !== null && _a !== void 0 ? _a : spec.chartType;
|
|
1652
1732
|
return seriesType === "bar" || seriesType === "column"
|
|
@@ -1670,29 +1750,29 @@ var BasicChart = function (_a) {
|
|
|
1670
1750
|
return (0, utils_1.chartPaletteColorAt)(seriesPalette, index);
|
|
1671
1751
|
};
|
|
1672
1752
|
_loop_1 = function (specSeriesIndex, series) {
|
|
1673
|
-
var dataLabel,
|
|
1674
|
-
var
|
|
1675
|
-
return tslib_1.__generator(this, function (
|
|
1676
|
-
switch (
|
|
1753
|
+
var dataLabel, _182, _183, effectiveChartType, lineLike, domainSources, pieDomainLabels, piePointOffset, data, seriesEchartsType, seriesStyleAttrs, seriesEntry, isBarOrColumn, seriesAny, markerSymbol, wantsMarkers, labelsWithoutMarkers, isolated, marked, isolated_1, isolated_1_1, i, gradientArgs, gradient, overrides_2, _184, _185, dp, fallback_1, overrides_3, _186, _187, dp, positiveColor_1, negativeColor_1;
|
|
1754
|
+
var e_12, _188, e_13, _189, e_14, _190;
|
|
1755
|
+
return tslib_1.__generator(this, function (_191) {
|
|
1756
|
+
switch (_191.label) {
|
|
1677
1757
|
case 0:
|
|
1678
1758
|
if (!(!(0, utils_1.isNil)(series.dataLabel) && (0, utils_1.isAFormula)(series.dataLabel))) return [3 /*break*/, 2];
|
|
1679
|
-
|
|
1680
|
-
return [4 /*yield*/, onRequestCalculate(series.dataLabel, (
|
|
1759
|
+
_183 = chart_spec_utils_1.coerceCalculatedLabel;
|
|
1760
|
+
return [4 /*yield*/, onRequestCalculate(series.dataLabel, (_95 = position.sheetId) !== null && _95 !== void 0 ? _95 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
|
|
1681
1761
|
case 1:
|
|
1682
|
-
|
|
1762
|
+
_182 = _183.apply(void 0, [_191.sent()]);
|
|
1683
1763
|
return [3 /*break*/, 3];
|
|
1684
1764
|
case 2:
|
|
1685
|
-
|
|
1686
|
-
|
|
1765
|
+
_182 = (_96 = series.dataLabel) !== null && _96 !== void 0 ? _96 : "";
|
|
1766
|
+
_191.label = 3;
|
|
1687
1767
|
case 3:
|
|
1688
|
-
dataLabel =
|
|
1768
|
+
dataLabel = _182;
|
|
1689
1769
|
// Label
|
|
1690
1770
|
if (dataLabel) {
|
|
1691
|
-
(
|
|
1771
|
+
(_97 = legend.data) === null || _97 === void 0 ? void 0 : _97.push(dataLabel);
|
|
1692
1772
|
}
|
|
1693
|
-
effectiveChartType = (
|
|
1773
|
+
effectiveChartType = (_98 = series.seriesChartType) !== null && _98 !== void 0 ? _98 : spec.chartType;
|
|
1694
1774
|
lineLike = (0, empty_cells_1.isLineLikeChartType)(effectiveChartType);
|
|
1695
|
-
domainSources = (
|
|
1775
|
+
domainSources = (_101 = (_100 = (_99 = spec.domains) === null || _99 === void 0 ? void 0 : _99[0]) === null || _100 === void 0 ? void 0 : _100.sources) !== null && _101 !== void 0 ? _101 : [];
|
|
1696
1776
|
pieDomainLabels = isCircularChart &&
|
|
1697
1777
|
(domainSources.length > 1 || series.sources.length > 1)
|
|
1698
1778
|
? domainSources.flatMap(function (sheetRange) {
|
|
@@ -1724,7 +1804,7 @@ var BasicChart = function (_a) {
|
|
|
1724
1804
|
seriesEntry = tslib_1.__assign(tslib_1.__assign({ type: seriesEchartsType,
|
|
1725
1805
|
// Ties the rendered series back to spec.series for click selection
|
|
1726
1806
|
// One rendered series per spec series (source index 0).
|
|
1727
|
-
id: (0, series_click_1.chartSeriesId)(specSeriesIndex, 0), name: dataLabel, data: data, stack: isStacked ? "dataLabel" : undefined, smooth: (
|
|
1807
|
+
id: (0, series_click_1.chartSeriesId)(specSeriesIndex, 0), name: dataLabel, data: data, stack: isStacked ? "dataLabel" : undefined, smooth: (_102 = spec.smooth) !== null && _102 !== void 0 ? _102 : undefined, radius: (_103 = spec.radius) !== null && _103 !== void 0 ? _103 : (isCircularChart ? [0, "75%"] : undefined) }, ((0, empty_cells_1.connectsAcrossEmptyCells)(spec, lineLike)
|
|
1728
1808
|
? { connectNulls: true }
|
|
1729
1809
|
: {})), seriesStyleAttrs);
|
|
1730
1810
|
// Plot this series against a secondary value axis. The 2nd
|
|
@@ -1749,17 +1829,17 @@ var BasicChart = function (_a) {
|
|
|
1749
1829
|
}
|
|
1750
1830
|
seriesAny = series;
|
|
1751
1831
|
if (effectiveChartType === "line") {
|
|
1752
|
-
markerSymbol = (
|
|
1832
|
+
markerSymbol = (_104 = seriesAny.marker) === null || _104 === void 0 ? void 0 : _104.symbol;
|
|
1753
1833
|
wantsMarkers = markerSymbol === "none"
|
|
1754
1834
|
? false
|
|
1755
1835
|
: Boolean(spec.showMarkers) || !(0, utils_1.isNil)(markerSymbol);
|
|
1756
1836
|
labelsWithoutMarkers = !wantsMarkers &&
|
|
1757
|
-
Boolean((
|
|
1837
|
+
Boolean((_105 = (0, overrides_1.resolveSeriesDataLabels)(spec.dataLabels, seriesAny)) === null || _105 === void 0 ? void 0 : _105.show);
|
|
1758
1838
|
seriesEntry.showSymbol = wantsMarkers || labelsWithoutMarkers;
|
|
1759
1839
|
if (wantsMarkers) {
|
|
1760
1840
|
seriesEntry.symbol =
|
|
1761
|
-
(
|
|
1762
|
-
seriesEntry.symbolSize = (
|
|
1841
|
+
(_106 = (0, helpers_1.mapMarkerSymbolToEcharts)(markerSymbol)) !== null && _106 !== void 0 ? _106 : "circle";
|
|
1842
|
+
seriesEntry.symbolSize = (_108 = (_107 = seriesAny.marker) === null || _107 === void 0 ? void 0 : _107.size) !== null && _108 !== void 0 ? _108 : 6;
|
|
1763
1843
|
}
|
|
1764
1844
|
else {
|
|
1765
1845
|
if (labelsWithoutMarkers) {
|
|
@@ -1774,17 +1854,17 @@ var BasicChart = function (_a) {
|
|
|
1774
1854
|
seriesEntry.symbol = "none";
|
|
1775
1855
|
marked = tslib_1.__spreadArray([], tslib_1.__read(data), false);
|
|
1776
1856
|
try {
|
|
1777
|
-
for (isolated_1 = (
|
|
1857
|
+
for (isolated_1 = (e_12 = void 0, tslib_1.__values(isolated)), isolated_1_1 = isolated_1.next(); !isolated_1_1.done; isolated_1_1 = isolated_1.next()) {
|
|
1778
1858
|
i = isolated_1_1.value;
|
|
1779
1859
|
marked[i] = { value: marked[i], symbol: "circle", symbolSize: 6 };
|
|
1780
1860
|
}
|
|
1781
1861
|
}
|
|
1782
|
-
catch (
|
|
1862
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1783
1863
|
finally {
|
|
1784
1864
|
try {
|
|
1785
|
-
if (isolated_1_1 && !isolated_1_1.done && (
|
|
1865
|
+
if (isolated_1_1 && !isolated_1_1.done && (_188 = isolated_1.return)) _188.call(isolated_1);
|
|
1786
1866
|
}
|
|
1787
|
-
finally { if (
|
|
1867
|
+
finally { if (e_12) throw e_12.error; }
|
|
1788
1868
|
}
|
|
1789
1869
|
seriesEntry.data = marked;
|
|
1790
1870
|
}
|
|
@@ -1794,9 +1874,9 @@ var BasicChart = function (_a) {
|
|
|
1794
1874
|
gradientArgs = (0, gradient_1.gradientToEcharts)(series.gradient);
|
|
1795
1875
|
if (gradientArgs && !seriesAny.noFill) {
|
|
1796
1876
|
gradient = new echarts.graphic.LinearGradient(gradientArgs.x, gradientArgs.y, gradientArgs.x2, gradientArgs.y2, gradientArgs.colorStops);
|
|
1797
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1877
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_109 = seriesEntry.itemStyle) !== null && _109 !== void 0 ? _109 : {})), { color: gradient });
|
|
1798
1878
|
if (effectiveChartType === "area") {
|
|
1799
|
-
seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1879
|
+
seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((_110 = seriesEntry.areaStyle) !== null && _110 !== void 0 ? _110 : {})), { color: gradient });
|
|
1800
1880
|
}
|
|
1801
1881
|
}
|
|
1802
1882
|
else if (seriesAny.noFill) {
|
|
@@ -1804,58 +1884,58 @@ var BasicChart = function (_a) {
|
|
|
1804
1884
|
// with `transparent` so layout is preserved but nothing
|
|
1805
1885
|
// paints. Legend entries are also suppressed via `name: ""`
|
|
1806
1886
|
// since the series carries no semantic information.
|
|
1807
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1887
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_111 = seriesEntry.itemStyle) !== null && _111 !== void 0 ? _111 : {})), { color: "transparent", borderColor: "transparent" });
|
|
1808
1888
|
}
|
|
1809
1889
|
else if (isBarOrColumn &&
|
|
1810
1890
|
Array.isArray(seriesAny.dataPointColors) &&
|
|
1811
1891
|
seriesAny.dataPointColors.length) {
|
|
1812
1892
|
overrides_2 = new Map();
|
|
1813
1893
|
try {
|
|
1814
|
-
for (
|
|
1815
|
-
dp =
|
|
1894
|
+
for (_184 = (e_13 = void 0, tslib_1.__values(seriesAny.dataPointColors)), _185 = _184.next(); !_185.done; _185 = _184.next()) {
|
|
1895
|
+
dp = _185.value;
|
|
1816
1896
|
if (typeof dp.idx === "number" && typeof dp.color === "string") {
|
|
1817
1897
|
overrides_2.set(dp.idx, dp.color);
|
|
1818
1898
|
}
|
|
1819
1899
|
}
|
|
1820
1900
|
}
|
|
1821
|
-
catch (
|
|
1901
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1822
1902
|
finally {
|
|
1823
1903
|
try {
|
|
1824
|
-
if (
|
|
1904
|
+
if (_185 && !_185.done && (_189 = _184.return)) _189.call(_184);
|
|
1825
1905
|
}
|
|
1826
|
-
finally { if (
|
|
1906
|
+
finally { if (e_13) throw e_13.error; }
|
|
1827
1907
|
}
|
|
1828
|
-
fallback_1 = (
|
|
1829
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1908
|
+
fallback_1 = (_112 = series.color) !== null && _112 !== void 0 ? _112 : paletteColorAt(specSeriesIndex);
|
|
1909
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_113 = seriesEntry.itemStyle) !== null && _113 !== void 0 ? _113 : {})), { color: function (params) { var _a; return (_a = overrides_2.get(params.dataIndex)) !== null && _a !== void 0 ? _a : fallback_1; } });
|
|
1830
1910
|
}
|
|
1831
1911
|
else if (isCircularChart &&
|
|
1832
1912
|
Array.isArray(seriesAny.dataPointColors) &&
|
|
1833
1913
|
seriesAny.dataPointColors.length) {
|
|
1834
1914
|
overrides_3 = new Map();
|
|
1835
1915
|
try {
|
|
1836
|
-
for (
|
|
1837
|
-
dp =
|
|
1916
|
+
for (_186 = (e_14 = void 0, tslib_1.__values(seriesAny.dataPointColors)), _187 = _186.next(); !_187.done; _187 = _186.next()) {
|
|
1917
|
+
dp = _187.value;
|
|
1838
1918
|
if (typeof dp.idx === "number" && typeof dp.color === "string") {
|
|
1839
1919
|
overrides_3.set(dp.idx, dp.color);
|
|
1840
1920
|
}
|
|
1841
1921
|
}
|
|
1842
1922
|
}
|
|
1843
|
-
catch (
|
|
1923
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1844
1924
|
finally {
|
|
1845
1925
|
try {
|
|
1846
|
-
if (
|
|
1926
|
+
if (_187 && !_187.done && (_190 = _186.return)) _190.call(_186);
|
|
1847
1927
|
}
|
|
1848
|
-
finally { if (
|
|
1928
|
+
finally { if (e_14) throw e_14.error; }
|
|
1849
1929
|
}
|
|
1850
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1930
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_114 = seriesEntry.itemStyle) !== null && _114 !== void 0 ? _114 : {})), { color: function (params) {
|
|
1851
1931
|
var _a, _b;
|
|
1852
1932
|
return (_b = (_a = overrides_3.get(params.dataIndex)) !== null && _a !== void 0 ? _a : series.color) !== null && _b !== void 0 ? _b : paletteColorAt(params.dataIndex);
|
|
1853
1933
|
} });
|
|
1854
1934
|
}
|
|
1855
1935
|
else if (isBarOrColumn && series.invertIfNegative) {
|
|
1856
|
-
positiveColor_1 = (
|
|
1857
|
-
negativeColor_1 = (
|
|
1858
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1936
|
+
positiveColor_1 = (_115 = series.color) !== null && _115 !== void 0 ? _115 : paletteColorAt(specSeriesIndex);
|
|
1937
|
+
negativeColor_1 = (_116 = series.negativeColor) !== null && _116 !== void 0 ? _116 : "#FF0000";
|
|
1938
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_117 = seriesEntry.itemStyle) !== null && _117 !== void 0 ? _117 : {})), { color: function (params) {
|
|
1859
1939
|
var _a, _b;
|
|
1860
1940
|
var value = Array.isArray(params.data)
|
|
1861
1941
|
? params.data[1]
|
|
@@ -1866,10 +1946,10 @@ var BasicChart = function (_a) {
|
|
|
1866
1946
|
} });
|
|
1867
1947
|
}
|
|
1868
1948
|
else if (series.color) {
|
|
1869
|
-
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1870
|
-
seriesEntry.lineStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1949
|
+
seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_118 = seriesEntry.itemStyle) !== null && _118 !== void 0 ? _118 : {})), { color: series.color });
|
|
1950
|
+
seriesEntry.lineStyle = tslib_1.__assign(tslib_1.__assign({}, ((_119 = seriesEntry.lineStyle) !== null && _119 !== void 0 ? _119 : {})), { color: series.color });
|
|
1871
1951
|
if (effectiveChartType === "area") {
|
|
1872
|
-
seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((
|
|
1952
|
+
seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((_120 = seriesEntry.areaStyle) !== null && _120 !== void 0 ? _120 : {})), { color: series.color });
|
|
1873
1953
|
}
|
|
1874
1954
|
}
|
|
1875
1955
|
chartSeries.push(seriesEntry);
|
|
@@ -1878,29 +1958,29 @@ var BasicChart = function (_a) {
|
|
|
1878
1958
|
}
|
|
1879
1959
|
});
|
|
1880
1960
|
};
|
|
1881
|
-
|
|
1961
|
+
_181.label = 31;
|
|
1882
1962
|
case 31:
|
|
1883
|
-
|
|
1884
|
-
_r = tslib_1.__values(((
|
|
1885
|
-
|
|
1963
|
+
_181.trys.push([31, 36, 37, 38]);
|
|
1964
|
+
_r = tslib_1.__values(((_94 = spec.series) !== null && _94 !== void 0 ? _94 : []).entries()), _s = _r.next();
|
|
1965
|
+
_181.label = 32;
|
|
1886
1966
|
case 32:
|
|
1887
1967
|
if (!!_s.done) return [3 /*break*/, 35];
|
|
1888
1968
|
_t = tslib_1.__read(_s.value, 2), specSeriesIndex = _t[0], series = _t[1];
|
|
1889
1969
|
return [5 /*yield**/, _loop_1(specSeriesIndex, series)];
|
|
1890
1970
|
case 33:
|
|
1891
|
-
|
|
1892
|
-
|
|
1971
|
+
_181.sent();
|
|
1972
|
+
_181.label = 34;
|
|
1893
1973
|
case 34:
|
|
1894
1974
|
_s = _r.next();
|
|
1895
1975
|
return [3 /*break*/, 32];
|
|
1896
1976
|
case 35: return [3 /*break*/, 38];
|
|
1897
1977
|
case 36:
|
|
1898
|
-
e_3_1 =
|
|
1978
|
+
e_3_1 = _181.sent();
|
|
1899
1979
|
e_3 = { error: e_3_1 };
|
|
1900
1980
|
return [3 /*break*/, 38];
|
|
1901
1981
|
case 37:
|
|
1902
1982
|
try {
|
|
1903
|
-
if (_s && !_s.done && (
|
|
1983
|
+
if (_s && !_s.done && (_4 = _r.return)) _4.call(_r);
|
|
1904
1984
|
}
|
|
1905
1985
|
finally { if (e_3) throw e_3.error; }
|
|
1906
1986
|
return [7 /*endfinally*/];
|
|
@@ -1913,7 +1993,7 @@ var BasicChart = function (_a) {
|
|
|
1913
1993
|
}
|
|
1914
1994
|
if (isOfPie) {
|
|
1915
1995
|
labels = rawPrimaryDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
1916
|
-
seriesEntry = (
|
|
1996
|
+
seriesEntry = (_121 = spec.series) === null || _121 === void 0 ? void 0 : _121[0];
|
|
1917
1997
|
rawValues = seriesEntry
|
|
1918
1998
|
? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); })
|
|
1919
1999
|
: [];
|
|
@@ -1960,7 +2040,7 @@ var BasicChart = function (_a) {
|
|
|
1960
2040
|
};
|
|
1961
2041
|
chartSeries.push({
|
|
1962
2042
|
type: "pie",
|
|
1963
|
-
name: (
|
|
2043
|
+
name: (_122 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _122 !== void 0 ? _122 : "",
|
|
1964
2044
|
center: ["".concat(MAIN_CX_1 * 100, "%"), "".concat(CY_1 * 100, "%")],
|
|
1965
2045
|
radius: [0, "".concat(MAIN_RADIUS_PCT_1, "%")],
|
|
1966
2046
|
// Rotate the pie so the "Other" slice's angular midpoint faces
|
|
@@ -1978,7 +2058,7 @@ var BasicChart = function (_a) {
|
|
|
1978
2058
|
if (ofPieType_1 === "pie") {
|
|
1979
2059
|
chartSeries.push({
|
|
1980
2060
|
type: "pie",
|
|
1981
|
-
name: (
|
|
2061
|
+
name: (_123 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _123 !== void 0 ? _123 : "",
|
|
1982
2062
|
center: ["".concat(SECONDARY_CX_1 * 100, "%"), "".concat(CY_1 * 100, "%")],
|
|
1983
2063
|
radius: [0, "".concat(secondaryRadiusPct_1, "%")],
|
|
1984
2064
|
data: secondary.map(function (s, i) { return ({
|
|
@@ -2073,16 +2153,16 @@ var BasicChart = function (_a) {
|
|
|
2073
2153
|
legend.data = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(main_1.map(function (s) { return s.label; })), false), tslib_1.__read(secondary.map(function (s) { return s.label; })), false);
|
|
2074
2154
|
}
|
|
2075
2155
|
else if (spec.chartType === "waterfall") {
|
|
2076
|
-
primaryDomainSource_1 = (
|
|
2156
|
+
primaryDomainSource_1 = (_126 = (_125 = (_124 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _124 === void 0 ? void 0 : _124[0]) === null || _125 === void 0 ? void 0 : _125.sources) === null || _126 === void 0 ? void 0 : _126[0];
|
|
2077
2157
|
rawDomainValues = primaryDomainSource_1
|
|
2078
|
-
? (0, aggregation_1.sanitizeDomainValues)((
|
|
2158
|
+
? (0, aggregation_1.sanitizeDomainValues)((_127 = getDomainValuesFromRange(primaryDomainSource_1, spec.hiddenDimensionStrategy)) !== null && _127 !== void 0 ? _127 : [])
|
|
2079
2159
|
: [];
|
|
2080
2160
|
labels = rawDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
2081
|
-
seriesEntry = (
|
|
2161
|
+
seriesEntry = (_128 = spec.series) === null || _128 === void 0 ? void 0 : _128[0];
|
|
2082
2162
|
rawValues_1 = seriesEntry
|
|
2083
2163
|
? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); })
|
|
2084
2164
|
: [];
|
|
2085
|
-
totalIndices = new Set((
|
|
2165
|
+
totalIndices = new Set((_129 = spec.totalIndices) !== null && _129 !== void 0 ? _129 : []);
|
|
2086
2166
|
steps = (0, waterfall_1.computeWaterfall)(rawValues_1, labels, totalIndices);
|
|
2087
2167
|
chartDomains.length = 0;
|
|
2088
2168
|
chartDomains.push({
|
|
@@ -2092,7 +2172,7 @@ var BasicChart = function (_a) {
|
|
|
2092
2172
|
axisLine: { show: true },
|
|
2093
2173
|
axisTick: { show: true },
|
|
2094
2174
|
splitLine: { show: false },
|
|
2095
|
-
name: (
|
|
2175
|
+
name: (_130 = spec.horizontalAxisTitle) !== null && _130 !== void 0 ? _130 : "",
|
|
2096
2176
|
nameLocation: "middle",
|
|
2097
2177
|
nameGap: 30,
|
|
2098
2178
|
});
|
|
@@ -2109,12 +2189,12 @@ var BasicChart = function (_a) {
|
|
|
2109
2189
|
label: { show: false },
|
|
2110
2190
|
tooltip: { show: false },
|
|
2111
2191
|
});
|
|
2112
|
-
accent_1 = (
|
|
2113
|
-
decreaseColor_1 = (
|
|
2114
|
-
totalColor_1 = (
|
|
2192
|
+
accent_1 = (_131 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _131 !== void 0 ? _131 : theme.themeColors.accent1;
|
|
2193
|
+
decreaseColor_1 = (_133 = (_132 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.negativeColor) !== null && _132 !== void 0 ? _132 : theme.themeColors.accent2) !== null && _133 !== void 0 ? _133 : accent_1;
|
|
2194
|
+
totalColor_1 = (_134 = theme.themeColors.accent3) !== null && _134 !== void 0 ? _134 : accent_1;
|
|
2115
2195
|
pointColors_1 = new Map();
|
|
2116
2196
|
try {
|
|
2117
|
-
for (_v = tslib_1.__values((
|
|
2197
|
+
for (_v = tslib_1.__values((_135 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataPointColors) !== null && _135 !== void 0 ? _135 : []), _w = _v.next(); !_w.done; _w = _v.next()) {
|
|
2118
2198
|
dp = _w.value;
|
|
2119
2199
|
if (typeof (dp === null || dp === void 0 ? void 0 : dp.idx) === "number" && typeof (dp === null || dp === void 0 ? void 0 : dp.color) === "string") {
|
|
2120
2200
|
pointColors_1.set(dp.idx, dp.color);
|
|
@@ -2124,7 +2204,7 @@ var BasicChart = function (_a) {
|
|
|
2124
2204
|
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
2125
2205
|
finally {
|
|
2126
2206
|
try {
|
|
2127
|
-
if (_w && !_w.done && (
|
|
2207
|
+
if (_w && !_w.done && (_5 = _v.return)) _5.call(_v);
|
|
2128
2208
|
}
|
|
2129
2209
|
finally { if (e_6) throw e_6.error; }
|
|
2130
2210
|
}
|
|
@@ -2136,7 +2216,7 @@ var BasicChart = function (_a) {
|
|
|
2136
2216
|
type: "bar",
|
|
2137
2217
|
id: (0, series_click_1.chartSeriesId)(0, 0),
|
|
2138
2218
|
stack: "waterfall",
|
|
2139
|
-
name: (
|
|
2219
|
+
name: (_136 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _136 !== void 0 ? _136 : "",
|
|
2140
2220
|
// A bar's height is the step's magnitude; the signed source value
|
|
2141
2221
|
// rides along as `originalValue` so labels and tooltips read
|
|
2142
2222
|
// "-90" for a decrease, like Excel.
|
|
@@ -2170,12 +2250,12 @@ var BasicChart = function (_a) {
|
|
|
2170
2250
|
legend.data = [];
|
|
2171
2251
|
}
|
|
2172
2252
|
else if (spec.chartType === "funnel") {
|
|
2173
|
-
primaryDomainSource_2 = (
|
|
2253
|
+
primaryDomainSource_2 = (_139 = (_138 = (_137 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _137 === void 0 ? void 0 : _137[0]) === null || _138 === void 0 ? void 0 : _138.sources) === null || _139 === void 0 ? void 0 : _139[0];
|
|
2174
2254
|
rawDomainValues = primaryDomainSource_2
|
|
2175
|
-
? (0, aggregation_1.sanitizeDomainValues)((
|
|
2255
|
+
? (0, aggregation_1.sanitizeDomainValues)((_140 = getDomainValuesFromRange(primaryDomainSource_2, spec.hiddenDimensionStrategy)) !== null && _140 !== void 0 ? _140 : [])
|
|
2176
2256
|
: [];
|
|
2177
2257
|
labels_1 = rawDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
|
|
2178
|
-
seriesEntry = (
|
|
2258
|
+
seriesEntry = (_141 = spec.series) === null || _141 === void 0 ? void 0 : _141[0];
|
|
2179
2259
|
rawValues = seriesEntry
|
|
2180
2260
|
? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : 0); })
|
|
2181
2261
|
: [];
|
|
@@ -2189,10 +2269,10 @@ var BasicChart = function (_a) {
|
|
|
2189
2269
|
theme.themeColors.accent5,
|
|
2190
2270
|
theme.themeColors.accent6,
|
|
2191
2271
|
]);
|
|
2192
|
-
funnelColor_1 = (
|
|
2272
|
+
funnelColor_1 = (_142 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _142 !== void 0 ? _142 : (0, utils_1.chartPaletteColorAt)(funnelPalette, 0);
|
|
2193
2273
|
stageColors_1 = new Map();
|
|
2194
2274
|
try {
|
|
2195
|
-
for (_x = tslib_1.__values((
|
|
2275
|
+
for (_x = tslib_1.__values((_143 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataPointColors) !== null && _143 !== void 0 ? _143 : []), _y = _x.next(); !_y.done; _y = _x.next()) {
|
|
2196
2276
|
dp = _y.value;
|
|
2197
2277
|
if (typeof (dp === null || dp === void 0 ? void 0 : dp.idx) === "number" && typeof (dp === null || dp === void 0 ? void 0 : dp.color) === "string") {
|
|
2198
2278
|
stageColors_1.set(dp.idx, dp.color);
|
|
@@ -2202,7 +2282,7 @@ var BasicChart = function (_a) {
|
|
|
2202
2282
|
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
2203
2283
|
finally {
|
|
2204
2284
|
try {
|
|
2205
|
-
if (_y && !_y.done && (
|
|
2285
|
+
if (_y && !_y.done && (_6 = _x.return)) _6.call(_x);
|
|
2206
2286
|
}
|
|
2207
2287
|
finally { if (e_7) throw e_7.error; }
|
|
2208
2288
|
}
|
|
@@ -2220,104 +2300,202 @@ var BasicChart = function (_a) {
|
|
|
2220
2300
|
top: 60,
|
|
2221
2301
|
bottom: 20,
|
|
2222
2302
|
};
|
|
2223
|
-
|
|
2303
|
+
funnelLabelsOff = ((_144 = (0, overrides_1.resolveSeriesDataLabels)(spec.dataLabels, seriesEntry)) === null || _144 === void 0 ? void 0 : _144.show) ===
|
|
2304
|
+
false;
|
|
2305
|
+
chartSeries.push(tslib_1.__assign(tslib_1.__assign({ type: "funnel", id: (0, series_click_1.chartSeriesId)(0, 0), name: (_145 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _145 !== void 0 ? _145 : "", data: funnelData }, funnelLayout), { itemStyle: {
|
|
2224
2306
|
color: function (params) { var _a; return (_a = stageColors_1.get(params.dataIndex)) !== null && _a !== void 0 ? _a : funnelColor_1; },
|
|
2225
|
-
}, label:
|
|
2226
|
-
show:
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2307
|
+
}, label: funnelLabelsOff
|
|
2308
|
+
? { show: false }
|
|
2309
|
+
: {
|
|
2310
|
+
show: true,
|
|
2311
|
+
position: "inside",
|
|
2312
|
+
formatter: function (params) {
|
|
2313
|
+
return (0, axis_number_format_1.formatAxisValue)(undefined, params.value, locale);
|
|
2314
|
+
},
|
|
2315
|
+
} }));
|
|
2232
2316
|
// The stage names sit to the left of the bars, where Excel's
|
|
2233
2317
|
// category axis puts them: an invisible twin funnel carries them.
|
|
2234
2318
|
chartSeries.push(tslib_1.__assign(tslib_1.__assign({ type: "funnel", id: FUNNEL_NAMES_ID, data: funnelData }, funnelLayout), { silent: true, itemStyle: { color: "transparent", borderWidth: 0 }, emphasis: { disabled: true }, tooltip: { show: false }, label: { show: true, position: "left", formatter: "{b}" }, labelLine: { show: false }, z: 1 }));
|
|
2235
|
-
legend.
|
|
2319
|
+
// The legend lists the series (shown when `legend.position` says so).
|
|
2320
|
+
legend.data = (seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) ? [seriesEntry.dataLabel] : [];
|
|
2236
2321
|
}
|
|
2237
2322
|
else if (spec.chartType === "boxplot") {
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
lo = showOutliers === true ? summary.lowerWhisker : summary.min;
|
|
2256
|
-
hi = showOutliers === true ? summary.upperWhisker : summary.max;
|
|
2257
|
-
boxStats.push([lo, summary.q1, summary.median, summary.q3, hi]);
|
|
2258
|
-
boxLabels.push(label);
|
|
2259
|
-
if (showOutliers === true) {
|
|
2260
|
-
try {
|
|
2261
|
-
for (_1 = (e_9 = void 0, tslib_1.__values(summary.outliers)), _2 = _1.next(); !_2.done; _2 = _1.next()) {
|
|
2262
|
-
outlier = _2.value;
|
|
2263
|
-
outlierPoints.push([boxIndex, outlier]);
|
|
2264
|
-
}
|
|
2265
|
-
}
|
|
2266
|
-
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
2267
|
-
finally {
|
|
2268
|
-
try {
|
|
2269
|
-
if (_2 && !_2.done && (_12 = _1.return)) _12.call(_1);
|
|
2270
|
-
}
|
|
2271
|
-
finally { if (e_9) throw e_9.error; }
|
|
2272
|
-
}
|
|
2273
|
-
}
|
|
2274
|
-
if (showMeanMarker) {
|
|
2275
|
-
meanPoints.push([boxIndex, summary.mean]);
|
|
2276
|
-
}
|
|
2323
|
+
quartileMethod_1 = spec.quartileMethod;
|
|
2324
|
+
showOutliers_1 = spec.showOutliers !== false;
|
|
2325
|
+
showMeanMarker_1 = spec.showMeanMarker === true;
|
|
2326
|
+
showInnerPoints_1 = spec.showInnerPoints === true;
|
|
2327
|
+
showMeanLine_1 = spec.showMeanLine === true;
|
|
2328
|
+
boxDomainSource = (_148 = (_147 = (_146 = spec.domains) === null || _146 === void 0 ? void 0 : _146[0]) === null || _147 === void 0 ? void 0 : _147.sources) === null || _148 === void 0 ? void 0 : _148[0];
|
|
2329
|
+
boxCategories_2 = boxDomainSource
|
|
2330
|
+
? ((_149 = getDomainValuesFromRange(boxDomainSource, spec.hiddenDimensionStrategy)) !== null && _149 !== void 0 ? _149 : []).map(function (v) { return (v === null || v === undefined ? "" : "".concat(v).trim()); })
|
|
2331
|
+
: [];
|
|
2332
|
+
grouped_1 = boxCategories_2.some(function (c) { return c !== ""; });
|
|
2333
|
+
groups_1 = [];
|
|
2334
|
+
if (grouped_1) {
|
|
2335
|
+
try {
|
|
2336
|
+
for (boxCategories_1 = tslib_1.__values(boxCategories_2), boxCategories_1_1 = boxCategories_1.next(); !boxCategories_1_1.done; boxCategories_1_1 = boxCategories_1.next()) {
|
|
2337
|
+
c = boxCategories_1_1.value;
|
|
2338
|
+
if (c !== "" && !groups_1.includes(c))
|
|
2339
|
+
groups_1.push(c);
|
|
2277
2340
|
}
|
|
2278
2341
|
}
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2342
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
2343
|
+
finally {
|
|
2344
|
+
try {
|
|
2345
|
+
if (boxCategories_1_1 && !boxCategories_1_1.done && (_7 = boxCategories_1.return)) _7.call(boxCategories_1);
|
|
2346
|
+
}
|
|
2347
|
+
finally { if (e_8) throw e_8.error; }
|
|
2284
2348
|
}
|
|
2285
|
-
finally { if (e_8) throw e_8.error; }
|
|
2286
2349
|
}
|
|
2350
|
+
boxSeriesSpecs = (_150 = spec.series) !== null && _150 !== void 0 ? _150 : [];
|
|
2351
|
+
slots_1 = grouped_1 ? groups_1 : boxSeriesSpecs.map(function (s, i) {
|
|
2352
|
+
return s.dataLabel && !(0, utils_1.isAFormula)(s.dataLabel) ? s.dataLabel : "Series ".concat(i + 1);
|
|
2353
|
+
});
|
|
2354
|
+
boxGap = typeof spec.gapWidth === "number" ? Math.max(0, spec.gapWidth) : 150;
|
|
2355
|
+
boxPlotWidth = Math.max(0, (width !== null && width !== void 0 ? width : 0) * 0.85 - 40);
|
|
2356
|
+
boxBand = slots_1.length ? boxPlotWidth / slots_1.length : boxPlotWidth;
|
|
2357
|
+
boxWidthMax_1 = Math.max(2, Math.round(boxBand / (Math.max(1, boxSeriesSpecs.length) + boxGap / 100)));
|
|
2358
|
+
boxCount_1 = Math.max(1, boxSeriesSpecs.length);
|
|
2359
|
+
slotX_1 = function (slotIndex, seriesIndex) {
|
|
2360
|
+
return slotIndex + ((seriesIndex + 0.5) / boxCount_1 - 0.5) * 0.8;
|
|
2361
|
+
};
|
|
2287
2362
|
chartDomains.length = 0;
|
|
2288
2363
|
chartDomains.push({
|
|
2289
2364
|
type: "category",
|
|
2290
|
-
data:
|
|
2365
|
+
data: slots_1,
|
|
2291
2366
|
show: showAxis,
|
|
2292
2367
|
axisLine: { show: true },
|
|
2293
2368
|
axisTick: { show: true },
|
|
2294
2369
|
splitLine: { show: false },
|
|
2295
|
-
name: (
|
|
2370
|
+
name: (_151 = spec.horizontalAxisTitle) !== null && _151 !== void 0 ? _151 : "",
|
|
2296
2371
|
nameLocation: "middle",
|
|
2297
2372
|
nameGap: 30,
|
|
2298
2373
|
});
|
|
2299
2374
|
chartSeries.length = 0;
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2375
|
+
boxLegend_1 = [];
|
|
2376
|
+
boxSeriesSpecs.forEach(function (seriesEntry, seriesIndex) {
|
|
2377
|
+
var _a;
|
|
2378
|
+
var label = seriesEntry.dataLabel && !(0, utils_1.isAFormula)(seriesEntry.dataLabel)
|
|
2379
|
+
? seriesEntry.dataLabel
|
|
2380
|
+
: "";
|
|
2381
|
+
var rawValues = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
|
|
2382
|
+
var color = (_a = seriesEntry.color) !== null && _a !== void 0 ? _a : paletteColorAt(seriesIndex);
|
|
2383
|
+
var boxData = [];
|
|
2384
|
+
var outlierPoints = [];
|
|
2385
|
+
var innerPoints = [];
|
|
2386
|
+
var meanPoints = [];
|
|
2387
|
+
var meanLine = [];
|
|
2388
|
+
var slotValues = grouped_1
|
|
2389
|
+
? groups_1.map(function (g) { return rawValues.filter(function (_, i) { return boxCategories_2[i] === g; }); })
|
|
2390
|
+
: slots_1.map(function (_, i) { return (i === seriesIndex ? rawValues : []); });
|
|
2391
|
+
slotValues.forEach(function (values, slotIndex) {
|
|
2392
|
+
var e_15, _a, e_16, _b;
|
|
2393
|
+
var summary = (0, boxplot_1.computeBoxplotSummary)(values, { quartileMethod: quartileMethod_1 });
|
|
2394
|
+
if (!summary) {
|
|
2395
|
+
boxData.push([]);
|
|
2396
|
+
meanLine.push(null);
|
|
2397
|
+
return;
|
|
2398
|
+
}
|
|
2399
|
+
// Whiskers stop at the most extreme points inside the 1.5×IQR
|
|
2400
|
+
// fences; hiding the outliers hides the points only (Excel).
|
|
2401
|
+
boxData.push([
|
|
2402
|
+
summary.lowerWhisker,
|
|
2403
|
+
summary.q1,
|
|
2404
|
+
summary.median,
|
|
2405
|
+
summary.q3,
|
|
2406
|
+
summary.upperWhisker,
|
|
2407
|
+
]);
|
|
2408
|
+
meanLine.push(summary.mean);
|
|
2409
|
+
var x = slotX_1(slotIndex, seriesIndex);
|
|
2410
|
+
if (showOutliers_1) {
|
|
2411
|
+
try {
|
|
2412
|
+
for (var _c = tslib_1.__values(summary.outliers), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
2413
|
+
var outlier = _d.value;
|
|
2414
|
+
outlierPoints.push([x, outlier]);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
2418
|
+
finally {
|
|
2419
|
+
try {
|
|
2420
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
2421
|
+
}
|
|
2422
|
+
finally { if (e_15) throw e_15.error; }
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
if (showInnerPoints_1) {
|
|
2426
|
+
try {
|
|
2427
|
+
for (var values_1 = tslib_1.__values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
|
|
2428
|
+
var v = values_1_1.value;
|
|
2429
|
+
if (v >= summary.lowerWhisker && v <= summary.upperWhisker) {
|
|
2430
|
+
innerPoints.push([x, v]);
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
catch (e_16_1) { e_16 = { error: e_16_1 }; }
|
|
2435
|
+
finally {
|
|
2436
|
+
try {
|
|
2437
|
+
if (values_1_1 && !values_1_1.done && (_b = values_1.return)) _b.call(values_1);
|
|
2438
|
+
}
|
|
2439
|
+
finally { if (e_16) throw e_16.error; }
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
if (showMeanMarker_1)
|
|
2443
|
+
meanPoints.push([x, summary.mean]);
|
|
2444
|
+
});
|
|
2445
|
+
if (label)
|
|
2446
|
+
boxLegend_1.push(label);
|
|
2447
|
+
chartSeries.push({
|
|
2448
|
+
type: "boxplot",
|
|
2449
|
+
id: (0, series_click_1.chartSeriesId)(seriesIndex, 0),
|
|
2450
|
+
name: label,
|
|
2451
|
+
data: boxData,
|
|
2452
|
+
boxWidth: [2, boxWidthMax_1],
|
|
2453
|
+
itemStyle: { color: color, borderColor: color },
|
|
2454
|
+
});
|
|
2455
|
+
var pointSeries = function (name, points, extra) {
|
|
2456
|
+
return (tslib_1.__assign({ type: "scatter", name: name, data: points, itemStyle: { color: color }, tooltip: { show: false } }, extra));
|
|
2457
|
+
};
|
|
2458
|
+
if (outlierPoints.length > 0) {
|
|
2459
|
+
chartSeries.push(pointSeries("", outlierPoints, { symbolSize: 6 }));
|
|
2460
|
+
}
|
|
2461
|
+
if (innerPoints.length > 0) {
|
|
2462
|
+
chartSeries.push(pointSeries("", innerPoints, { symbolSize: 4, itemStyle: { color: color, opacity: 0.6 } }));
|
|
2463
|
+
}
|
|
2464
|
+
if (meanPoints.length > 0) {
|
|
2465
|
+
chartSeries.push(pointSeries("", meanPoints, { symbol: "diamond", symbolSize: 9 }));
|
|
2466
|
+
}
|
|
2467
|
+
if (showMeanLine_1 && meanLine.some(function (m) { return m !== null; })) {
|
|
2468
|
+
chartSeries.push({
|
|
2469
|
+
type: "line",
|
|
2470
|
+
name: "",
|
|
2471
|
+
data: meanLine.map(function (m, slotIndex) {
|
|
2472
|
+
return m === null ? null : [slotX_1(slotIndex, seriesIndex), m];
|
|
2473
|
+
}),
|
|
2474
|
+
showSymbol: false,
|
|
2475
|
+
lineStyle: { color: color, type: "dashed", width: 1 },
|
|
2476
|
+
itemStyle: { color: color },
|
|
2477
|
+
tooltip: { show: false },
|
|
2478
|
+
z: 3,
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2481
|
+
});
|
|
2482
|
+
// The legend lists the series (shown when `legend.position` says so).
|
|
2483
|
+
legend.data = boxLegend_1;
|
|
2317
2484
|
}
|
|
2318
2485
|
else if (spec.chartType === "histogram") {
|
|
2319
2486
|
rawValues = flattenChartDataValues(spec.series, getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
|
|
2320
|
-
|
|
2487
|
+
histogramDomainSource = (_154 = (_153 = (_152 = spec.domains) === null || _152 === void 0 ? void 0 : _152[0]) === null || _153 === void 0 ? void 0 : _153.sources) === null || _154 === void 0 ? void 0 : _154[0];
|
|
2488
|
+
histogramCategories = histogramDomainSource
|
|
2489
|
+
? ((_155 = getDomainValuesFromRange(histogramDomainSource, spec.hiddenDimensionStrategy)) !== null && _155 !== void 0 ? _155 : [])
|
|
2490
|
+
: [];
|
|
2491
|
+
_z = histogramCategories.length
|
|
2492
|
+
? (0, histogram_1.aggregateByCategory)(histogramCategories, rawValues, (_158 = (_157 = (_156 = spec.series) === null || _156 === void 0 ? void 0 : _156[0]) === null || _157 === void 0 ? void 0 : _157.aggregateType) !== null && _158 !== void 0 ? _158 : "SUM")
|
|
2493
|
+
: (0, histogram_1.binHistogram)(rawValues, spec.binCount, {
|
|
2494
|
+
binSize: spec.binSize,
|
|
2495
|
+
intervalClosed: spec.intervalClosed,
|
|
2496
|
+
overflow: spec.overflow,
|
|
2497
|
+
underflow: spec.underflow,
|
|
2498
|
+
}), labels = _z.labels, counts = _z.counts;
|
|
2321
2499
|
isPareto_1 = (0, histogram_1.isParetoSpec)(spec);
|
|
2322
2500
|
cumulativePercents = [];
|
|
2323
2501
|
if (isPareto_1) {
|
|
@@ -2334,34 +2512,32 @@ var BasicChart = function (_a) {
|
|
|
2334
2512
|
axisLine: { show: true },
|
|
2335
2513
|
axisTick: { show: true },
|
|
2336
2514
|
splitLine: { show: false },
|
|
2337
|
-
name: (
|
|
2515
|
+
name: (_159 = spec.horizontalAxisTitle) !== null && _159 !== void 0 ? _159 : "",
|
|
2338
2516
|
nameLocation: "middle",
|
|
2339
2517
|
nameGap: 30,
|
|
2340
2518
|
});
|
|
2341
2519
|
chartSeries.length = 0;
|
|
2342
2520
|
histogramSeries = {
|
|
2343
2521
|
type: "bar",
|
|
2344
|
-
name: (
|
|
2522
|
+
name: (_162 = (_161 = (_160 = spec.series) === null || _160 === void 0 ? void 0 : _160[0]) === null || _161 === void 0 ? void 0 : _161.dataLabel) !== null && _162 !== void 0 ? _162 : "",
|
|
2345
2523
|
data: counts,
|
|
2346
|
-
|
|
2524
|
+
// Excel's histogram columns touch unless `gapWidth` says otherwise
|
|
2525
|
+
// (#1087); the gap maps like a column chart's.
|
|
2526
|
+
barCategoryGap: (_164 = (0, bar_layout_1.gapWidthToBarCategoryGap)((_163 = spec.gapWidth) !== null && _163 !== void 0 ? _163 : 0, { seriesCount: 1 })) !== null && _164 !== void 0 ? _164 : "0%",
|
|
2347
2527
|
};
|
|
2348
|
-
histogramColor = (
|
|
2528
|
+
histogramColor = (_166 = (_165 = spec.series) === null || _165 === void 0 ? void 0 : _165[0]) === null || _166 === void 0 ? void 0 : _166.color;
|
|
2349
2529
|
if (histogramColor) {
|
|
2350
2530
|
histogramSeries.itemStyle = { color: histogramColor };
|
|
2351
2531
|
}
|
|
2352
2532
|
chartSeries.push(histogramSeries);
|
|
2353
2533
|
if (isPareto_1) {
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
yAxisIndex: 1,
|
|
2362
|
-
symbol: "circle",
|
|
2363
|
-
symbolSize: 6,
|
|
2364
|
-
});
|
|
2534
|
+
paretoLineColor = spec.paretoLineColor;
|
|
2535
|
+
chartSeries.push(tslib_1.__assign({ type: "line", name: "Cumulative %", data: cumulativePercents, yAxisIndex: 1, showSymbol: false, symbol: "none" }, (paretoLineColor
|
|
2536
|
+
? {
|
|
2537
|
+
itemStyle: { color: paretoLineColor },
|
|
2538
|
+
lineStyle: { color: paretoLineColor },
|
|
2539
|
+
}
|
|
2540
|
+
: {})));
|
|
2365
2541
|
}
|
|
2366
2542
|
legend.data = [];
|
|
2367
2543
|
}
|
|
@@ -2382,20 +2558,20 @@ var BasicChart = function (_a) {
|
|
|
2382
2558
|
isPareto = spec.chartType === "histogram" && (0, histogram_1.isParetoSpec)(spec);
|
|
2383
2559
|
hasSecondaryAxis = !isCircularChart &&
|
|
2384
2560
|
!isHorizontalBarChart &&
|
|
2385
|
-
(((
|
|
2561
|
+
(((_167 = spec.series) !== null && _167 !== void 0 ? _167 : []).some(function (s) { return s.useSecondaryAxis; }) || isPareto);
|
|
2386
2562
|
isPercentStackedBars = spec.stackedType === "PERCENT_STACKED" &&
|
|
2387
2563
|
(spec.chartType === "bar" || spec.chartType === "column");
|
|
2388
2564
|
primaryAxisNumberFormat = isPercentStackedBars
|
|
2389
2565
|
? undefined
|
|
2390
2566
|
: (0, axis_number_format_1.resolveValueAxisNumberFormat)({
|
|
2391
2567
|
axisOptions: spec.valueAxisOptions,
|
|
2392
|
-
series: ((
|
|
2568
|
+
series: ((_168 = spec.series) !== null && _168 !== void 0 ? _168 : []).filter(function (s) { return !s.useSecondaryAxis; }),
|
|
2393
2569
|
getFormattingFromRange: getFormattingFromRange,
|
|
2394
2570
|
hiddenDimensionStrategy: spec.hiddenDimensionStrategy,
|
|
2395
2571
|
});
|
|
2396
2572
|
secondaryAxisNumberFormat = (0, axis_number_format_1.resolveValueAxisNumberFormat)({
|
|
2397
2573
|
axisOptions: spec.secondaryValueAxisOptions,
|
|
2398
|
-
series: ((
|
|
2574
|
+
series: ((_169 = spec.series) !== null && _169 !== void 0 ? _169 : []).filter(function (s) { return s.useSecondaryAxis; }),
|
|
2399
2575
|
getFormattingFromRange: getFormattingFromRange,
|
|
2400
2576
|
hiddenDimensionStrategy: spec.hiddenDimensionStrategy,
|
|
2401
2577
|
});
|
|
@@ -2424,17 +2600,17 @@ var BasicChart = function (_a) {
|
|
|
2424
2600
|
finalLegend = (0, overrides_1.applyLegendOverrides)(legend, spec.legend);
|
|
2425
2601
|
bottomAxisNameGap = isHorizontalBarChart
|
|
2426
2602
|
? valueAxisBase.nameGap
|
|
2427
|
-
: Number((
|
|
2603
|
+
: Number((_171 = (_170 = chartDomains[0]) === null || _170 === void 0 ? void 0 : _170.nameGap) !== null && _171 !== void 0 ? _171 : CATEGORY_AXIS_NAME_GAP);
|
|
2428
2604
|
legendBand = (0, legend_layout_1.reserveEchartsLegendBand)({
|
|
2429
|
-
position: (
|
|
2605
|
+
position: (_172 = spec.legend) === null || _172 === void 0 ? void 0 : _172.position,
|
|
2430
2606
|
visible: finalLegend.show !== false,
|
|
2431
2607
|
labels: (0, legend_layout_1.legendLabelsFrom)(finalLegend.data, chartSeries.map(function (s) { return s === null || s === void 0 ? void 0 : s.name; })),
|
|
2432
|
-
legendFontSize: (
|
|
2608
|
+
legendFontSize: (_177 = (_174 = (_173 = finalLegend.textStyle) === null || _173 === void 0 ? void 0 : _173.fontSize) !== null && _174 !== void 0 ? _174 : (_176 = (_175 = spec.legend) === null || _175 === void 0 ? void 0 : _175.textFormat) === null || _176 === void 0 ? void 0 : _176.fontSize) !== null && _177 !== void 0 ? _177 : 12,
|
|
2433
2609
|
legendItemWidth: defaultLegendConfig.itemWidth,
|
|
2434
2610
|
width: width !== null && width !== void 0 ? width : 0,
|
|
2435
2611
|
height: height !== null && height !== void 0 ? height : 0,
|
|
2436
2612
|
hasTitle: Boolean(title),
|
|
2437
|
-
titleFontSize: (
|
|
2613
|
+
titleFontSize: (_179 = (_178 = spec.titleTextFormat) === null || _178 === void 0 ? void 0 : _178.fontSize) !== null && _179 !== void 0 ? _179 : 16,
|
|
2438
2614
|
hasBottomAxisTitle: !isCircularChart && Boolean(spec.horizontalAxisTitle),
|
|
2439
2615
|
bottomAxisNameGap: bottomAxisNameGap,
|
|
2440
2616
|
hasLeftAxisTitle: !isCircularChart && Boolean(spec.verticalAxisTitle),
|
|
@@ -2507,12 +2683,12 @@ var BasicChart = function (_a) {
|
|
|
2507
2683
|
}
|
|
2508
2684
|
}
|
|
2509
2685
|
}
|
|
2510
|
-
catch (
|
|
2686
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
2511
2687
|
finally {
|
|
2512
2688
|
try {
|
|
2513
|
-
if (barSeries_1_1 && !barSeries_1_1.done && (
|
|
2689
|
+
if (barSeries_1_1 && !barSeries_1_1.done && (_8 = barSeries_1.return)) _8.call(barSeries_1);
|
|
2514
2690
|
}
|
|
2515
|
-
finally { if (
|
|
2691
|
+
finally { if (e_9) throw e_9.error; }
|
|
2516
2692
|
}
|
|
2517
2693
|
try {
|
|
2518
2694
|
for (barSeries_2 = tslib_1.__values(barSeries), barSeries_2_1 = barSeries_2.next(); !barSeries_2_1.done; barSeries_2_1 = barSeries_2.next()) {
|
|
@@ -2529,12 +2705,12 @@ var BasicChart = function (_a) {
|
|
|
2529
2705
|
});
|
|
2530
2706
|
}
|
|
2531
2707
|
}
|
|
2532
|
-
catch (
|
|
2708
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
2533
2709
|
finally {
|
|
2534
2710
|
try {
|
|
2535
|
-
if (barSeries_2_1 && !barSeries_2_1.done && (
|
|
2711
|
+
if (barSeries_2_1 && !barSeries_2_1.done && (_9 = barSeries_2.return)) _9.call(barSeries_2);
|
|
2536
2712
|
}
|
|
2537
|
-
finally { if (
|
|
2713
|
+
finally { if (e_10) throw e_10.error; }
|
|
2538
2714
|
}
|
|
2539
2715
|
}
|
|
2540
2716
|
seriesWithLabels = chartSeries.map(function (s) {
|
|
@@ -2604,7 +2780,7 @@ var BasicChart = function (_a) {
|
|
|
2604
2780
|
return next;
|
|
2605
2781
|
});
|
|
2606
2782
|
// Update charts
|
|
2607
|
-
(
|
|
2783
|
+
(_180 = chartRef.current) === null || _180 === void 0 ? void 0 : _180.setOption({
|
|
2608
2784
|
xAxis: (function () {
|
|
2609
2785
|
var _a, _b;
|
|
2610
2786
|
if (isOfPie) {
|