@rowsncolumns/charts 28.1.17 → 28.1.19

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.
Files changed (90) hide show
  1. package/Readme.md +18 -1
  2. package/dist/cjs/basic-chart/basic-chart.d.ts +1 -1
  3. package/dist/cjs/basic-chart/basic-chart.d.ts.map +1 -1
  4. package/dist/cjs/basic-chart/basic-chart.js +371 -242
  5. package/dist/cjs/basic-chart/helpers.d.ts +7 -3
  6. package/dist/cjs/basic-chart/helpers.d.ts.map +1 -1
  7. package/dist/cjs/basic-chart/helpers.js +30 -4
  8. package/dist/cjs/basic-chart/index.d.ts +7 -0
  9. package/dist/cjs/basic-chart/index.d.ts.map +1 -1
  10. package/dist/cjs/basic-chart/index.js +19 -2
  11. package/dist/cjs/components/editors/chart-editor.d.ts +7 -1
  12. package/dist/cjs/components/editors/chart-editor.d.ts.map +1 -1
  13. package/dist/cjs/components/editors/chart-editor.js +24 -14
  14. package/dist/cjs/components/editors/fields/axis-options-fields.d.ts +6 -3
  15. package/dist/cjs/components/editors/fields/axis-options-fields.d.ts.map +1 -1
  16. package/dist/cjs/components/editors/fields/axis-options-fields.js +69 -7
  17. package/dist/cjs/components/editors/fields/chart-elements-fields.d.ts +15 -0
  18. package/dist/cjs/components/editors/fields/chart-elements-fields.d.ts.map +1 -0
  19. package/dist/cjs/components/editors/fields/chart-elements-fields.js +23 -0
  20. package/dist/cjs/components/editors/fields/series-format-fields.d.ts.map +1 -1
  21. package/dist/cjs/components/editors/fields/series-format-fields.js +16 -2
  22. package/dist/cjs/config.d.ts +10 -0
  23. package/dist/cjs/config.d.ts.map +1 -1
  24. package/dist/cjs/config.js +45 -10
  25. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  26. package/dist/cjs/types.d.ts +10 -0
  27. package/dist/cjs/types.d.ts.map +1 -1
  28. package/dist/cjs/utils/chart-lines.d.ts +36 -0
  29. package/dist/cjs/utils/chart-lines.d.ts.map +1 -0
  30. package/dist/cjs/utils/chart-lines.js +111 -0
  31. package/dist/cjs/utils/data-table.d.ts +31 -0
  32. package/dist/cjs/utils/data-table.d.ts.map +1 -0
  33. package/dist/cjs/utils/data-table.js +61 -0
  34. package/dist/cjs/utils/echarts-gl-loader.d.ts +6 -0
  35. package/dist/cjs/utils/echarts-gl-loader.d.ts.map +1 -1
  36. package/dist/cjs/utils/echarts-gl-loader.js +42 -1
  37. package/dist/cjs/utils/excel-axis-scale.d.ts +35 -0
  38. package/dist/cjs/utils/excel-axis-scale.d.ts.map +1 -0
  39. package/dist/cjs/utils/excel-axis-scale.js +210 -0
  40. package/dist/cjs/utils/overrides.d.ts +24 -3
  41. package/dist/cjs/utils/overrides.d.ts.map +1 -1
  42. package/dist/cjs/utils/overrides.js +119 -14
  43. package/dist/cjs/utils/three-d.d.ts +12 -1
  44. package/dist/cjs/utils/three-d.d.ts.map +1 -1
  45. package/dist/cjs/utils/three-d.js +4 -1
  46. package/dist/esm/basic-chart/basic-chart.d.ts +1 -1
  47. package/dist/esm/basic-chart/basic-chart.d.ts.map +1 -1
  48. package/dist/esm/basic-chart/basic-chart.js +237 -73
  49. package/dist/esm/basic-chart/helpers.d.ts +7 -3
  50. package/dist/esm/basic-chart/helpers.d.ts.map +1 -1
  51. package/dist/esm/basic-chart/helpers.js +26 -3
  52. package/dist/esm/basic-chart/index.d.ts +7 -0
  53. package/dist/esm/basic-chart/index.d.ts.map +1 -1
  54. package/dist/esm/basic-chart/index.js +15 -1
  55. package/dist/esm/components/editors/chart-editor.d.ts +7 -1
  56. package/dist/esm/components/editors/chart-editor.d.ts.map +1 -1
  57. package/dist/esm/components/editors/chart-editor.js +16 -4
  58. package/dist/esm/components/editors/fields/axis-options-fields.d.ts +6 -3
  59. package/dist/esm/components/editors/fields/axis-options-fields.d.ts.map +1 -1
  60. package/dist/esm/components/editors/fields/axis-options-fields.js +56 -5
  61. package/dist/esm/components/editors/fields/chart-elements-fields.d.ts +15 -0
  62. package/dist/esm/components/editors/fields/chart-elements-fields.d.ts.map +1 -0
  63. package/dist/esm/components/editors/fields/chart-elements-fields.js +17 -0
  64. package/dist/esm/components/editors/fields/series-format-fields.d.ts.map +1 -1
  65. package/dist/esm/components/editors/fields/series-format-fields.js +9 -1
  66. package/dist/esm/config.d.ts +10 -0
  67. package/dist/esm/config.d.ts.map +1 -1
  68. package/dist/esm/config.js +20 -0
  69. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  70. package/dist/esm/types.d.ts +10 -0
  71. package/dist/esm/types.d.ts.map +1 -1
  72. package/dist/esm/utils/chart-lines.d.ts +36 -0
  73. package/dist/esm/utils/chart-lines.d.ts.map +1 -0
  74. package/dist/esm/utils/chart-lines.js +121 -0
  75. package/dist/esm/utils/data-table.d.ts +31 -0
  76. package/dist/esm/utils/data-table.d.ts.map +1 -0
  77. package/dist/esm/utils/data-table.js +48 -0
  78. package/dist/esm/utils/echarts-gl-loader.d.ts +6 -0
  79. package/dist/esm/utils/echarts-gl-loader.d.ts.map +1 -1
  80. package/dist/esm/utils/echarts-gl-loader.js +40 -0
  81. package/dist/esm/utils/excel-axis-scale.d.ts +35 -0
  82. package/dist/esm/utils/excel-axis-scale.d.ts.map +1 -0
  83. package/dist/esm/utils/excel-axis-scale.js +122 -0
  84. package/dist/esm/utils/overrides.d.ts +24 -3
  85. package/dist/esm/utils/overrides.d.ts.map +1 -1
  86. package/dist/esm/utils/overrides.js +111 -10
  87. package/dist/esm/utils/three-d.d.ts +12 -1
  88. package/dist/esm/utils/three-d.d.ts.map +1 -1
  89. package/dist/esm/utils/three-d.js +4 -1
  90. package/package.json +7 -7
@@ -20,13 +20,16 @@ var boxplot_1 = require("../utils/boxplot");
20
20
  var bubble_1 = require("../utils/bubble");
21
21
  var category_levels_1 = require("../utils/category-levels");
22
22
  var chart_image_1 = require("../utils/chart-image");
23
+ var chart_lines_1 = require("../utils/chart-lines");
23
24
  var chart_orientation_1 = require("../utils/chart-orientation");
24
25
  var chart_spec_utils_1 = require("../utils/chart-spec-utils");
25
26
  var chart_styles_1 = require("../utils/chart-styles");
27
+ var data_table_1 = require("../utils/data-table");
26
28
  var doughnut_1 = require("../utils/doughnut");
27
29
  var echarts_gl_loader_1 = require("../utils/echarts-gl-loader");
28
30
  var echarts_overlays_1 = require("../utils/echarts-overlays");
29
31
  var empty_cells_1 = require("../utils/empty-cells");
32
+ var excel_axis_scale_1 = require("../utils/excel-axis-scale");
30
33
  var gradient_1 = require("../utils/gradient");
31
34
  var hierarchy_1 = require("../utils/hierarchy");
32
35
  var histogram_1 = require("../utils/histogram");
@@ -254,11 +257,37 @@ var defaultLegendConfig = {
254
257
  };
255
258
  /** Category-axis title gap: clears one row of tick labels (#986). */
256
259
  var CATEGORY_AXIS_NAME_GAP = (0, legend_layout_1.categoryAxisNameGap)();
260
+ /**
261
+ * Excel's chart text colour: Text 1 at 65% (`<a:schemeClr val="tx1"><a:lumMod
262
+ * val="65000"/><a:lumOff val="35000"/>`, #595959 on the light theme) — RD-24.
263
+ */
264
+ var chartTextColor = function (theme, isDarkMode) {
265
+ return (0, spreadsheet_1.getStringifiedColor)({ theme: 1, tint: isDarkMode ? 1 : 0.35 }, theme);
266
+ };
267
+ /** The theme's body (minor) font, which Excel's chart text uses. */
268
+ var chartFontFamily = function (theme) {
269
+ return (theme === null || theme === void 0 ? void 0 : theme.primaryFontFamily) ? "".concat(theme.primaryFontFamily, ", sans-serif") : "sans-serif";
270
+ };
271
+ /** Chart types whose value axes take Excel's automatic bounds and major unit. */
272
+ var AUTO_SCALE_CHART_TYPES = new Set([
273
+ "column",
274
+ "bar",
275
+ "line",
276
+ "area",
277
+ "combo",
278
+ ]);
257
279
  var BasicChart = function (_a) {
258
- var _b, _c, _d;
259
- var width = _a.width, height = _a.height, chart = _a.chart, theme = _a.theme, isDarkMode = _a.isDarkMode, sheetId = _a.sheetId, readonly = _a.readonly, getDomainValuesFromRange = _a.getDomainValuesFromRange, getSeriesValuesFromRange = _a.getSeriesValuesFromRange, getFormattingFromRange = _a.getFormattingFromRange, onDeleteChart = _a.onDeleteChart, onUpdateChart = _a.onUpdateChart, onRequestEdit = _a.onRequestEdit, onRequestCalculate = _a.onRequestCalculate, isSelected = _a.isSelected, fieldButtons = _a.fieldButtons, locale = _a.locale;
280
+ var _b, _c, _d, _e, _f;
281
+ var width = _a.width, height = _a.height, chart = _a.chart, theme = _a.theme, isDarkMode = _a.isDarkMode, sheetId = _a.sheetId, readonly = _a.readonly, getDomainValuesFromRange = _a.getDomainValuesFromRange, getSeriesValuesFromRange = _a.getSeriesValuesFromRange, getFormattingFromRange = _a.getFormattingFromRange, onDeleteChart = _a.onDeleteChart, onUpdateChart = _a.onUpdateChart, onRequestEdit = _a.onRequestEdit, onRequestCalculate = _a.onRequestCalculate, isSelected = _a.isSelected, fieldButtons = _a.fieldButtons, locale = _a.locale, enable3D = _a.enable3D;
260
282
  var spec = chart.spec;
261
- var explicitChartTitle = (_b = chart.spec.title) !== null && _b !== void 0 ? _b : undefined;
283
+ // A title linked to a cell shows the cell's text (FT-08); `title` is its last copy.
284
+ var titleSource = chart.spec.titleSource;
285
+ var linkedTitleValue = titleSource
286
+ ? (_b = getDomainValuesFromRange(titleSource)) === null || _b === void 0 ? void 0 : _b[0]
287
+ : undefined;
288
+ var explicitChartTitle = (_d = (_c = (linkedTitleValue !== undefined && linkedTitleValue !== null && linkedTitleValue !== ""
289
+ ? String(linkedTitleValue)
290
+ : undefined)) !== null && _c !== void 0 ? _c : chart.spec.title) !== null && _d !== void 0 ? _d : undefined;
262
291
  var hierarchyTitleRef = (0, react_1.useRef)(explicitChartTitle);
263
292
  var title = explicitChartTitle !== null && explicitChartTitle !== void 0 ? explicitChartTitle : hierarchyTitleRef.current;
264
293
  var el = (0, react_1.useRef)(null);
@@ -311,7 +340,7 @@ var BasicChart = function (_a) {
311
340
  // the chart upgrades from the immediate 2-D fallback to true 3-D.
312
341
  var renderedIn3D = (0, react_1.useRef)(false);
313
342
  var glUpgradeRequested = (0, react_1.useRef)(false);
314
- var _e = tslib_1.__read((0, react_1.useState)(0), 2), glUpgradeTick = _e[0], setGlUpgradeTick = _e[1];
343
+ var _g = tslib_1.__read((0, react_1.useState)(0), 2), glUpgradeTick = _g[0], setGlUpgradeTick = _g[1];
315
344
  // Region-map (choropleth) pipeline state. The map option (geo +
316
345
  // visualMap) doesn't merge back into a cartesian one, so the instance
317
346
  // is re-initialized when entering/leaving the region-map rendering.
@@ -430,14 +459,14 @@ var BasicChart = function (_a) {
430
459
  * Triggers a chart update
431
460
  */
432
461
  var updateChart = function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
433
- var threeDRenderKind, canRender3D, willRender3D, isRegionMap, regionSpec, geoScope, geo, labels, seriesEntry, values, _a, data, unmatched, min, max, textColor, ramp, noDataColor, borderColor, regionSeriesLabel, seriesName, boxplotOverlayAxis, chartDomains, chartSeries, legend, chartType, position, showAxis, isBubble, isHierarchy, skipHeaders_1, labelValues, perSeriesX, perSeriesSize, seriesInputs, i, seriesEntry, linkedLabel, 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, _h, values, e_1_1, seriesNames_1, contourPoints, _j, zMin, zMax, contourFormats_1, contourLabel, categories_3, threeDSeriesInputs, _k, _l, seriesEntry, dataLabel, _m, _o, _p, 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, _q, zMin, zMax, skipHeaders, categories, radarSeriesInputs, _r, _s, 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, _t, _u, _v, specSeriesIndex, series, e_3_1, labels, seriesEntry, rawValues, _w, 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, _x, _y, dp, connectors, primaryDomainSource_2, rawDomainValues, labels_1, seriesEntry, rawValues, funnelPalette, funnelColor_1, stageColors_1, _z, _0, 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, boxGap, boxPlotWidth, boxBand_1, boxWidthMax_1, boxCount_1, boxCentre_1, boxLegend_1, rawValues, histogramDomainSource, histogramCategories, _1, 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;
462
+ var threeDRenderKind, canRender3D, willRender3D, isRegionMap, regionSpec, geoScope, geo, labels, seriesEntry, values, _a, data, unmatched, min, max, textColor, ramp, noDataColor, borderColor, regionSeriesLabel, seriesName, boxplotOverlayAxis, chartDomains, chartSeries, legend, chartType, position, showAxis, isBubble, isHierarchy, skipHeaders_1, labelValues, perSeriesX, perSeriesSize, seriesInputs, i, seriesEntry, linkedLabel, 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, _h, values, e_1_1, seriesNames_1, contourPoints, _j, zMin, zMax, contourFormats_1, contourLabel, categories_3, threeDSeriesInputs, _k, _l, seriesEntry, dataLabel, _m, _o, _p, 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, _q, zMin, zMax, error_1, skipHeaders, categories, radarSeriesInputs, _r, _s, 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, axisTextColor, axisTextStyle, isCircularChart, isOfPie, ofPieLayout, isHorizontalBarChart, shouldAggregate, primaryDomainSource, rawPrimaryDomainValues, aggregateDomainValues, categoryLevels, pushSeriesOverlays, sideBySideBarCount, specBarGap, specBarCategoryGap, seriesPalette, paletteColorAt, _loop_1, _t, _u, _v, specSeriesIndex, series, e_3_1, labels, seriesEntry, rawValues, _w, 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, _x, _y, dp, connectors, primaryDomainSource_2, rawDomainValues, labels_1, seriesEntry, rawValues, funnelPalette, funnelColor_1, stageColors_1, _z, _0, 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, boxGap, boxPlotWidth, boxBand_1, boxWidthMax_1, boxCount_1, boxCentre_1, boxLegend_1, rawValues, histogramDomainSource, histogramCategories, _1, labels, counts, isPareto_1, cumulativePercents, pareto, histogramSeries, histogramColor, paretoLineColor, lineElementOptions, lineData, 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, bareCategoryAxis, pointCount, dataTableOptions, dataTableRows, dataTableAxisList, autoScaleEligible, withExcelAutoScale;
434
463
  var e_1, _2, e_2, _3, e_4, _4, e_5, _5, e_3, _6, e_6, _7, e_7, _8, e_8, _9, e_9, _10, e_10, _11;
435
- var _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, _181, _182, _183, _184, _185, _186, _187;
436
- return tslib_1.__generator(this, function (_188) {
437
- switch (_188.label) {
464
+ var _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, _181;
465
+ return tslib_1.__generator(this, function (_182) {
466
+ switch (_182.label) {
438
467
  case 0:
439
468
  (0, utils_1.debug)("Updating chart", chart);
440
- threeDRenderKind = (0, three_d_1.resolve3DRenderKind)(spec.sourceChartType);
469
+ threeDRenderKind = (0, three_d_1.resolve3DRenderKind)(spec.sourceChartType, { enable3D: enable3D });
441
470
  canRender3D = threeDRenderKind !== null && (0, webgl_1.isWebGLAvailable)();
442
471
  willRender3D = canRender3D && (0, echarts_gl_loader_1.getEchartsGlState)() === "ready";
443
472
  if (canRender3D && !willRender3D && (0, echarts_gl_loader_1.getEchartsGlState)() !== "failed") {
@@ -485,7 +514,7 @@ var BasicChart = function (_a) {
485
514
  geoScope = (0, region_map_1.resolveGeoScope)(regionSpec.geoScope);
486
515
  return [4 /*yield*/, (0, region_map_loader_1.loadRegionMapGeo)(geoScope)];
487
516
  case 1:
488
- geo = _188.sent();
517
+ geo = _182.sent();
489
518
  // Entering the region map from a cartesian render: the previous
490
519
  // grid/axis option doesn't merge into the map one, so start from
491
520
  // a bare instance (theme options are re-applied after setOption).
@@ -600,7 +629,7 @@ var BasicChart = function (_a) {
600
629
  });
601
630
  seriesInputs = [];
602
631
  i = 0;
603
- _188.label = 3;
632
+ _182.label = 3;
604
633
  case 3:
605
634
  if (!(i < spec.series.length)) return [3 /*break*/, 7];
606
635
  seriesEntry = spec.series[i];
@@ -610,13 +639,13 @@ var BasicChart = function (_a) {
610
639
  _b = chart_spec_utils_1.coerceCalculatedLabel;
611
640
  return [4 /*yield*/, onRequestCalculate(resolvedLabel, (_21 = position.sheetId) !== null && _21 !== void 0 ? _21 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
612
641
  case 4:
613
- resolvedLabel = _b.apply(void 0, [_188.sent()]);
614
- _188.label = 5;
642
+ resolvedLabel = _b.apply(void 0, [_182.sent()]);
643
+ _182.label = 5;
615
644
  case 5:
616
645
  xValues = (_22 = perSeriesX[i]) !== null && _22 !== void 0 ? _22 : perSeriesX[0];
617
646
  sizeValues_1 = (_23 = perSeriesSize[i]) !== null && _23 !== void 0 ? _23 : perSeriesSize[0];
618
647
  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 } : {})));
619
- _188.label = 6;
648
+ _182.label = 6;
620
649
  case 6:
621
650
  i++;
622
651
  return [3 /*break*/, 3];
@@ -764,24 +793,24 @@ var BasicChart = function (_a) {
764
793
  position: (_29 = spec.legend) === null || _29 === void 0 ? void 0 : _29.position,
765
794
  visible: bubbleLegend.show !== false,
766
795
  labels: preparedSeries.map(function (entry) { return entry.name; }),
767
- legendFontSize: (_34 = (_31 = (_30 = bubbleLegend.textStyle) === null || _30 === void 0 ? void 0 : _30.fontSize) !== null && _31 !== void 0 ? _31 : (_33 = (_32 = spec.legend) === null || _32 === void 0 ? void 0 : _32.textFormat) === null || _33 === void 0 ? void 0 : _33.fontSize) !== null && _34 !== void 0 ? _34 : 12,
796
+ legendFontSize: (_31 = (_30 = bubbleLegend.textStyle) === null || _30 === void 0 ? void 0 : _30.fontSize) !== null && _31 !== void 0 ? _31 : (0, overrides_2.fontSizePx)((_33 = (_32 = spec.legend) === null || _32 === void 0 ? void 0 : _32.textFormat) === null || _33 === void 0 ? void 0 : _33.fontSize, overrides_2.CHART_TEXT_PX),
768
797
  legendItemWidth: defaultLegendConfig.itemWidth,
769
798
  width: width !== null && width !== void 0 ? width : 0,
770
799
  height: height !== null && height !== void 0 ? height : 0,
771
800
  hasTitle: Boolean(explicitChartTitle),
772
- titleFontSize: (_36 = (_35 = spec.titleTextFormat) === null || _35 === void 0 ? void 0 : _35.fontSize) !== null && _36 !== void 0 ? _36 : 16,
801
+ titleFontSize: (0, overrides_2.fontSizePx)((_34 = spec.titleTextFormat) === null || _34 === void 0 ? void 0 : _34.fontSize, overrides_2.CHART_TITLE_PX),
773
802
  hasBottomAxisTitle: Boolean(spec.horizontalAxisTitle),
774
803
  bottomAxisNameGap: 30,
775
804
  hasLeftAxisTitle: Boolean(spec.verticalAxisTitle),
776
805
  });
777
- (_37 = chartRef.current) === null || _37 === void 0 ? void 0 : _37.setOption({
806
+ (_35 = chartRef.current) === null || _35 === void 0 ? void 0 : _35.setOption({
778
807
  xAxis: [
779
- (0, overrides_1.applyAxisOverrides)(tslib_1.__assign({}, xAxisConfig), spec.categoryAxisOptions),
808
+ (0, overrides_1.applyAxisOverrides)(tslib_1.__assign({}, xAxisConfig), spec.categoryAxisOptions, undefined, undefined, "x"),
780
809
  ],
781
810
  yAxis: tslib_1.__spreadArray([
782
811
  (0, overrides_1.applyAxisOverrides)({
783
812
  type: "value",
784
- name: (_38 = spec.verticalAxisTitle) !== null && _38 !== void 0 ? _38 : "",
813
+ name: (_36 = spec.verticalAxisTitle) !== null && _36 !== void 0 ? _36 : "",
785
814
  nameLocation: "middle",
786
815
  nameGap: 45,
787
816
  }, spec.valueAxisOptions, undefined, locale)
@@ -842,9 +871,9 @@ var BasicChart = function (_a) {
842
871
  isTreemap = spec.chartType === "treemap";
843
872
  banner = isTreemap && treemapBannerShown(spec.parentLabelLayout);
844
873
  hierarchyData = colorHierarchyNodes((0, hierarchy_1.buildHierarchyTree)(hierarchyRows), hierarchyPalette, { banner: banner });
845
- rootName = hierarchyData.length === 1 ? (_40 = (_39 = hierarchyData[0]) === null || _39 === void 0 ? void 0 : _39.name) !== null && _40 !== void 0 ? _40 : "" : "";
874
+ rootName = hierarchyData.length === 1 ? (_38 = (_37 = hierarchyData[0]) === null || _37 === void 0 ? void 0 : _37.name) !== null && _38 !== void 0 ? _38 : "" : "";
846
875
  drillDown = Boolean(spec.drillDown);
847
- seriesDisplayName = (_42 = (_41 = explicitChartTitle !== null && explicitChartTitle !== void 0 ? explicitChartTitle : headerTitle) !== null && _41 !== void 0 ? _41 : rootName) !== null && _42 !== void 0 ? _42 : "";
876
+ seriesDisplayName = (_40 = (_39 = explicitChartTitle !== null && explicitChartTitle !== void 0 ? explicitChartTitle : headerTitle) !== null && _39 !== void 0 ? _39 : rootName) !== null && _40 !== void 0 ? _40 : "";
848
877
  hierarchyDepth = getHierarchyDepth(hierarchyData);
849
878
  levels = buildHierarchyLevels(hierarchyDepth, {
850
879
  treemap: isTreemap,
@@ -866,7 +895,7 @@ var BasicChart = function (_a) {
866
895
  });
867
896
  })
868
897
  : [];
869
- sizeNumberFormat_1 = (0, axis_number_format_1.resolveSourceNumberFormat)((_44 = (_43 = spec.sizeData) === null || _43 === void 0 ? void 0 : _43[0]) === null || _44 === void 0 ? void 0 : _44.sources, getFormattingFromRange, spec.hiddenDimensionStrategy);
898
+ sizeNumberFormat_1 = (0, axis_number_format_1.resolveSourceNumberFormat)((_42 = (_41 = spec.sizeData) === null || _41 === void 0 ? void 0 : _41[0]) === null || _42 === void 0 ? void 0 : _42.sources, getFormattingFromRange, spec.hiddenDimensionStrategy);
870
899
  tooltipFormatter = function (params) {
871
900
  var _a;
872
901
  var value = Array.isArray(params.value)
@@ -882,20 +911,20 @@ var BasicChart = function (_a) {
882
911
  : (hierarchyLabelOpts === null || hierarchyLabelOpts === void 0 ? void 0 : hierarchyLabelOpts.show)
883
912
  ? 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" } : {}));
884
913
  hierarchyBand = (0, legend_layout_1.reserveEchartsLegendBand)({
885
- position: (_45 = spec.legend) === null || _45 === void 0 ? void 0 : _45.position,
914
+ position: (_43 = spec.legend) === null || _43 === void 0 ? void 0 : _43.position,
886
915
  visible: legendShown && hierarchyData.length > 0,
887
916
  labels: hierarchyData.map(function (node) { return node.name; }),
888
- legendFontSize: (_50 = (_47 = (_46 = hierarchyLegend.textStyle) === null || _46 === void 0 ? void 0 : _46.fontSize) !== null && _47 !== void 0 ? _47 : (_49 = (_48 = spec.legend) === null || _48 === void 0 ? void 0 : _48.textFormat) === null || _49 === void 0 ? void 0 : _49.fontSize) !== null && _50 !== void 0 ? _50 : 12,
917
+ legendFontSize: (_45 = (_44 = hierarchyLegend.textStyle) === null || _44 === void 0 ? void 0 : _44.fontSize) !== null && _45 !== void 0 ? _45 : (0, overrides_2.fontSizePx)((_47 = (_46 = spec.legend) === null || _46 === void 0 ? void 0 : _46.textFormat) === null || _47 === void 0 ? void 0 : _47.fontSize, overrides_2.CHART_TEXT_PX),
889
918
  legendItemWidth: defaultLegendConfig.itemWidth,
890
919
  width: width !== null && width !== void 0 ? width : 0,
891
920
  height: height !== null && height !== void 0 ? height : 0,
892
921
  hasTitle: Boolean(explicitChartTitle !== null && explicitChartTitle !== void 0 ? explicitChartTitle : headerTitle),
893
- titleFontSize: (_52 = (_51 = spec.titleTextFormat) === null || _51 === void 0 ? void 0 : _51.fontSize) !== null && _52 !== void 0 ? _52 : 16,
922
+ titleFontSize: (0, overrides_2.fontSizePx)((_48 = spec.titleTextFormat) === null || _48 === void 0 ? void 0 : _48.fontSize, overrides_2.CHART_TITLE_PX),
894
923
  hasBottomAxisTitle: false,
895
924
  bottomAxisNameGap: 0,
896
925
  hasLeftAxisTitle: false,
897
926
  });
898
- (_53 = chartRef.current) === null || _53 === void 0 ? void 0 : _53.setOption({
927
+ (_49 = chartRef.current) === null || _49 === void 0 ? void 0 : _49.setOption({
899
928
  xAxis: [
900
929
  {
901
930
  type: "category",
@@ -967,7 +996,7 @@ var BasicChart = function (_a) {
967
996
  }
968
997
  isContour = (0, three_d_1.isContourSpec)(spec);
969
998
  if (renderedAsContour.current && !isContour) {
970
- (_54 = chartRef.current) === null || _54 === void 0 ? void 0 : _54.dispose();
999
+ (_50 = chartRef.current) === null || _50 === void 0 ? void 0 : _50.dispose();
971
1000
  chartRef.current = undefined;
972
1001
  renderedAsContour.current = false;
973
1002
  previousChartType.current = undefined;
@@ -978,41 +1007,41 @@ var BasicChart = function (_a) {
978
1007
  if (!isContour) return [3 /*break*/, 21];
979
1008
  categories_2 = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
980
1009
  contourSeriesInputs = [];
981
- _188.label = 9;
1010
+ _182.label = 9;
982
1011
  case 9:
983
- _188.trys.push([9, 18, 19, 20]);
984
- _d = tslib_1.__values((_55 = spec.series) !== null && _55 !== void 0 ? _55 : []), _e = _d.next();
985
- _188.label = 10;
1012
+ _182.trys.push([9, 18, 19, 20]);
1013
+ _d = tslib_1.__values((_51 = spec.series) !== null && _51 !== void 0 ? _51 : []), _e = _d.next();
1014
+ _182.label = 10;
986
1015
  case 10:
987
1016
  if (!!_e.done) return [3 /*break*/, 17];
988
1017
  seriesEntry = _e.value;
989
- if (!((_56 = (0, series_name_1.linkedSeriesName)(seriesEntry, getDomainValuesFromRange)) !== null && _56 !== void 0)) return [3 /*break*/, 11];
990
- _f = _56;
1018
+ if (!((_52 = (0, series_name_1.linkedSeriesName)(seriesEntry, getDomainValuesFromRange)) !== null && _52 !== void 0)) return [3 /*break*/, 11];
1019
+ _f = _52;
991
1020
  return [3 /*break*/, 15];
992
1021
  case 11:
993
1022
  if (!(!(0, utils_1.isNil)(seriesEntry.dataLabel) && (0, utils_1.isAFormula)(seriesEntry.dataLabel))) return [3 /*break*/, 13];
994
1023
  _h = chart_spec_utils_1.coerceCalculatedLabel;
995
- return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_57 = position.sheetId) !== null && _57 !== void 0 ? _57 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
1024
+ return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_53 = position.sheetId) !== null && _53 !== void 0 ? _53 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
996
1025
  case 12:
997
- _g = _h.apply(void 0, [_188.sent()]);
1026
+ _g = _h.apply(void 0, [_182.sent()]);
998
1027
  return [3 /*break*/, 14];
999
1028
  case 13:
1000
- _g = (_58 = seriesEntry.dataLabel) !== null && _58 !== void 0 ? _58 : "";
1001
- _188.label = 14;
1029
+ _g = (_54 = seriesEntry.dataLabel) !== null && _54 !== void 0 ? _54 : "";
1030
+ _182.label = 14;
1002
1031
  case 14:
1003
1032
  _f = (_g);
1004
- _188.label = 15;
1033
+ _182.label = 15;
1005
1034
  case 15:
1006
1035
  dataLabel = _f;
1007
1036
  values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(sanitizeChartValue);
1008
1037
  contourSeriesInputs.push({ name: dataLabel, values: values });
1009
- _188.label = 16;
1038
+ _182.label = 16;
1010
1039
  case 16:
1011
1040
  _e = _d.next();
1012
1041
  return [3 /*break*/, 10];
1013
1042
  case 17: return [3 /*break*/, 20];
1014
1043
  case 18:
1015
- e_1_1 = _188.sent();
1044
+ e_1_1 = _182.sent();
1016
1045
  e_1 = { error: e_1_1 };
1017
1046
  return [3 /*break*/, 20];
1018
1047
  case 19:
@@ -1037,7 +1066,7 @@ var BasicChart = function (_a) {
1037
1066
  chartRef.current = echarts.init(el.current);
1038
1067
  bindSeriesSelection(chartRef.current);
1039
1068
  }
1040
- (_59 = chartRef.current) === null || _59 === void 0 ? void 0 : _59.setOption({
1069
+ (_55 = chartRef.current) === null || _55 === void 0 ? void 0 : _55.setOption({
1041
1070
  tooltip: {
1042
1071
  textStyle: { fontSize: 12 },
1043
1072
  trigger: "item",
@@ -1057,7 +1086,7 @@ var BasicChart = function (_a) {
1057
1086
  type: "category",
1058
1087
  data: categories_2,
1059
1088
  splitArea: { show: true },
1060
- name: (_60 = spec.horizontalAxisTitle) !== null && _60 !== void 0 ? _60 : "",
1089
+ name: (_56 = spec.horizontalAxisTitle) !== null && _56 !== void 0 ? _56 : "",
1061
1090
  nameLocation: "middle",
1062
1091
  nameGap: 30,
1063
1092
  }, spec.categoryAxisOptions),
@@ -1067,7 +1096,7 @@ var BasicChart = function (_a) {
1067
1096
  type: "category",
1068
1097
  data: seriesNames_1,
1069
1098
  splitArea: { show: true },
1070
- name: (_61 = spec.verticalAxisTitle) !== null && _61 !== void 0 ? _61 : "",
1099
+ name: (_57 = spec.verticalAxisTitle) !== null && _57 !== void 0 ? _57 : "",
1071
1100
  nameLocation: "middle",
1072
1101
  nameGap: 50,
1073
1102
  },
@@ -1117,44 +1146,44 @@ var BasicChart = function (_a) {
1117
1146
  previousSeriesCount.current = 1;
1118
1147
  return [2 /*return*/];
1119
1148
  case 21:
1120
- if (!(willRender3D && threeDRenderKind)) return [3 /*break*/, 34];
1149
+ if (!(willRender3D && threeDRenderKind)) return [3 /*break*/, 38];
1121
1150
  categories_3 = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
1122
1151
  threeDSeriesInputs = [];
1123
- _188.label = 22;
1152
+ _182.label = 22;
1124
1153
  case 22:
1125
- _188.trys.push([22, 31, 32, 33]);
1126
- _k = tslib_1.__values((_62 = spec.series) !== null && _62 !== void 0 ? _62 : []), _l = _k.next();
1127
- _188.label = 23;
1154
+ _182.trys.push([22, 31, 32, 33]);
1155
+ _k = tslib_1.__values((_58 = spec.series) !== null && _58 !== void 0 ? _58 : []), _l = _k.next();
1156
+ _182.label = 23;
1128
1157
  case 23:
1129
1158
  if (!!_l.done) return [3 /*break*/, 30];
1130
1159
  seriesEntry = _l.value;
1131
- if (!((_63 = (0, series_name_1.linkedSeriesName)(seriesEntry, getDomainValuesFromRange)) !== null && _63 !== void 0)) return [3 /*break*/, 24];
1132
- _m = _63;
1160
+ if (!((_59 = (0, series_name_1.linkedSeriesName)(seriesEntry, getDomainValuesFromRange)) !== null && _59 !== void 0)) return [3 /*break*/, 24];
1161
+ _m = _59;
1133
1162
  return [3 /*break*/, 28];
1134
1163
  case 24:
1135
1164
  if (!(!(0, utils_1.isNil)(seriesEntry.dataLabel) && (0, utils_1.isAFormula)(seriesEntry.dataLabel))) return [3 /*break*/, 26];
1136
1165
  _p = chart_spec_utils_1.coerceCalculatedLabel;
1137
- return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_64 = position.sheetId) !== null && _64 !== void 0 ? _64 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
1166
+ return [4 /*yield*/, onRequestCalculate(seriesEntry.dataLabel, (_60 = position.sheetId) !== null && _60 !== void 0 ? _60 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
1138
1167
  case 25:
1139
- _o = _p.apply(void 0, [_188.sent()]);
1168
+ _o = _p.apply(void 0, [_182.sent()]);
1140
1169
  return [3 /*break*/, 27];
1141
1170
  case 26:
1142
- _o = (_65 = seriesEntry.dataLabel) !== null && _65 !== void 0 ? _65 : "";
1143
- _188.label = 27;
1171
+ _o = (_61 = seriesEntry.dataLabel) !== null && _61 !== void 0 ? _61 : "";
1172
+ _182.label = 27;
1144
1173
  case 27:
1145
1174
  _m = (_o);
1146
- _188.label = 28;
1175
+ _182.label = 28;
1147
1176
  case 28:
1148
1177
  dataLabel = _m;
1149
1178
  values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(sanitizeChartValue);
1150
1179
  threeDSeriesInputs.push({ name: dataLabel, values: values });
1151
- _188.label = 29;
1180
+ _182.label = 29;
1152
1181
  case 29:
1153
1182
  _l = _k.next();
1154
1183
  return [3 /*break*/, 23];
1155
1184
  case 30: return [3 /*break*/, 33];
1156
1185
  case 31:
1157
- e_2_1 = _188.sent();
1186
+ e_2_1 = _182.sent();
1158
1187
  e_2 = { error: e_2_1 };
1159
1188
  return [3 /*break*/, 33];
1160
1189
  case 32:
@@ -1323,12 +1352,15 @@ var BasicChart = function (_a) {
1323
1352
  inRange: { color: tslib_1.__spreadArray([], tslib_1.__read(three_d_1.SURFACE_COLOR_RAMP), false) },
1324
1353
  };
1325
1354
  }
1326
- (_66 = chartRef.current) === null || _66 === void 0 ? void 0 : _66.setOption(tslib_1.__assign(tslib_1.__assign({ tooltip: {
1355
+ _182.label = 34;
1356
+ case 34:
1357
+ _182.trys.push([34, 35, , 37]);
1358
+ (_62 = chartRef.current) === null || _62 === void 0 ? void 0 : _62.setOption(tslib_1.__assign(tslib_1.__assign({ tooltip: {
1327
1359
  textStyle: { fontSize: 12 },
1328
1360
  formatter: threeDTooltipFormatter,
1329
1361
  }, legend: threeDRenderKind === "line3D" || stackedBar3D_1
1330
1362
  ? (0, overrides_1.applyLegendOverrides)(tslib_1.__assign(tslib_1.__assign({}, defaultLegendConfig), { show: seriesNames_2.length > 1, data: seriesNames_2 }), spec.legend)
1331
- : { show: false }, xAxis3D: tslib_1.__assign(tslib_1.__assign({}, xAxis3D), { name: (_67 = spec.horizontalAxisTitle) !== null && _67 !== void 0 ? _67 : "" }), yAxis3D: tslib_1.__assign(tslib_1.__assign({}, yAxis3D), { name: "" }), zAxis3D: { type: "value", name: (_68 = spec.verticalAxisTitle) !== null && _68 !== void 0 ? _68 : "" }, grid3D: {
1363
+ : { show: false }, xAxis3D: tslib_1.__assign(tslib_1.__assign({}, xAxis3D), { name: (_63 = spec.horizontalAxisTitle) !== null && _63 !== void 0 ? _63 : "" }), yAxis3D: tslib_1.__assign(tslib_1.__assign({}, yAxis3D), { name: "" }), zAxis3D: { type: "value", name: (_64 = spec.verticalAxisTitle) !== null && _64 !== void 0 ? _64 : "" }, grid3D: {
1332
1364
  boxDepth: Math.max(20, Math.min(100, seriesNames_2.length * 20)),
1333
1365
  viewControl: { autoRotate: false },
1334
1366
  } }, (visualMap ? { visualMap: [visualMap] } : {})), { series: threeDSeries }), {
@@ -1342,6 +1374,27 @@ var BasicChart = function (_a) {
1342
1374
  "tooltip",
1343
1375
  ],
1344
1376
  });
1377
+ return [3 /*break*/, 37];
1378
+ case 35:
1379
+ error_1 = _182.sent();
1380
+ (0, echarts_gl_loader_1.markEchartsGlFailed)(error_1);
1381
+ try {
1382
+ (_65 = chartRef.current) === null || _65 === void 0 ? void 0 : _65.dispose();
1383
+ }
1384
+ catch (_183) {
1385
+ // A GL instance that threw mid-build may not dispose cleanly.
1386
+ }
1387
+ chartRef.current = undefined;
1388
+ renderedIn3D.current = false;
1389
+ previousChartType.current = undefined;
1390
+ previousSeriesCount.current = undefined;
1391
+ initializeChart();
1392
+ applyThemeOptions();
1393
+ return [4 /*yield*/, updateChart()];
1394
+ case 36:
1395
+ _182.sent();
1396
+ return [2 /*return*/];
1397
+ case 37:
1345
1398
  // Re-apply theme-derived title / palette / tooltip colors — lost
1346
1399
  // when the instance was re-initialized on entry into 3-D.
1347
1400
  renderedIn3D.current = true;
@@ -1349,7 +1402,7 @@ var BasicChart = function (_a) {
1349
1402
  previousChartType.current = spec.chartType;
1350
1403
  previousSeriesCount.current = threeDSeries.length;
1351
1404
  return [2 /*return*/];
1352
- case 34:
1405
+ case 38:
1353
1406
  // ---------------------------- Radar ----------------------------
1354
1407
  // Radar is polar: a top-level `radar.indicator` list (one axis per
1355
1408
  // category) plus one `radar`-type series carrying every data series'
@@ -1359,9 +1412,9 @@ var BasicChart = function (_a) {
1359
1412
  categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, skipHeaders);
1360
1413
  radarSeriesInputs = [];
1361
1414
  try {
1362
- for (_r = tslib_1.__values((_69 = spec.series) !== null && _69 !== void 0 ? _69 : []), _s = _r.next(); !_s.done; _s = _r.next()) {
1415
+ for (_r = tslib_1.__values((_66 = spec.series) !== null && _66 !== void 0 ? _66 : []), _s = _r.next(); !_s.done; _s = _r.next()) {
1363
1416
  seriesEntry = _s.value;
1364
- label = (_70 = (0, series_name_1.linkedSeriesName)(seriesEntry, getDomainValuesFromRange)) !== null && _70 !== void 0 ? _70 : (seriesEntry.dataLabel && !(0, utils_1.isAFormula)(seriesEntry.dataLabel)
1417
+ label = (_67 = (0, series_name_1.linkedSeriesName)(seriesEntry, getDomainValuesFromRange)) !== null && _67 !== void 0 ? _67 : (seriesEntry.dataLabel && !(0, utils_1.isAFormula)(seriesEntry.dataLabel)
1365
1418
  ? seriesEntry.dataLabel
1366
1419
  : "");
1367
1420
  values = flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
@@ -1378,7 +1431,7 @@ var BasicChart = function (_a) {
1378
1431
  radarAxisOptions_1 = spec.valueAxisOptions;
1379
1432
  indicators_1 = (0, radar_1.buildRadarIndicators)(categories, radarSeriesInputs, radarAxisOptions_1);
1380
1433
  radarData = (0, radar_1.buildRadarSeriesData)(radarSeriesInputs, indicators_1.length);
1381
- radarStyle_1 = (_71 = spec.radarStyle) !== null && _71 !== void 0 ? _71 : "standard";
1434
+ radarStyle_1 = (_68 = spec.radarStyle) !== null && _68 !== void 0 ? _68 : "standard";
1382
1435
  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; });
1383
1436
  radarFormats_1 = (0, axis_number_format_1.resolveSeriesNumberFormats)(spec.series, getFormattingFromRange, spec.hiddenDimensionStrategy);
1384
1437
  radarDataLabels_1 = spec.dataLabels;
@@ -1397,15 +1450,15 @@ var BasicChart = function (_a) {
1397
1450
  };
1398
1451
  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);
1399
1452
  radarBand = (0, legend_layout_1.reserveEchartsLegendBand)({
1400
- position: (_72 = spec.legend) === null || _72 === void 0 ? void 0 : _72.position,
1453
+ position: (_69 = spec.legend) === null || _69 === void 0 ? void 0 : _69.position,
1401
1454
  visible: radarLegend.show !== false,
1402
1455
  labels: radarData.map(function (d) { return d.name; }),
1403
- legendFontSize: (_77 = (_74 = (_73 = radarLegend.textStyle) === null || _73 === void 0 ? void 0 : _73.fontSize) !== null && _74 !== void 0 ? _74 : (_76 = (_75 = spec.legend) === null || _75 === void 0 ? void 0 : _75.textFormat) === null || _76 === void 0 ? void 0 : _76.fontSize) !== null && _77 !== void 0 ? _77 : 12,
1456
+ legendFontSize: (_71 = (_70 = radarLegend.textStyle) === null || _70 === void 0 ? void 0 : _70.fontSize) !== null && _71 !== void 0 ? _71 : (0, overrides_2.fontSizePx)((_73 = (_72 = spec.legend) === null || _72 === void 0 ? void 0 : _72.textFormat) === null || _73 === void 0 ? void 0 : _73.fontSize, overrides_2.CHART_TEXT_PX),
1404
1457
  legendItemWidth: defaultLegendConfig.itemWidth,
1405
1458
  width: width !== null && width !== void 0 ? width : 0,
1406
1459
  height: height !== null && height !== void 0 ? height : 0,
1407
1460
  hasTitle: Boolean(explicitChartTitle),
1408
- titleFontSize: (_79 = (_78 = spec.titleTextFormat) === null || _78 === void 0 ? void 0 : _78.fontSize) !== null && _79 !== void 0 ? _79 : 16,
1461
+ titleFontSize: (0, overrides_2.fontSizePx)((_74 = spec.titleTextFormat) === null || _74 === void 0 ? void 0 : _74.fontSize, overrides_2.CHART_TITLE_PX),
1409
1462
  hasBottomAxisTitle: false,
1410
1463
  bottomAxisNameGap: 0,
1411
1464
  hasLeftAxisTitle: false,
@@ -1421,7 +1474,7 @@ var BasicChart = function (_a) {
1421
1474
  radius: Math.max(10, Math.min(radarPlotWidth, radarPlotHeight) / 2 - 30),
1422
1475
  }
1423
1476
  : {};
1424
- (_80 = chartRef.current) === null || _80 === void 0 ? void 0 : _80.setOption({
1477
+ (_75 = chartRef.current) === null || _75 === void 0 ? void 0 : _75.setOption({
1425
1478
  radar: tslib_1.__assign(tslib_1.__assign({}, radarGeometry), {
1426
1479
  // The common scale's tick labels along ONE axis, as Excel draws
1427
1480
  // them: echarts labels every indicator axis, so each indicator
@@ -1475,9 +1528,9 @@ var BasicChart = function (_a) {
1475
1528
  // V-variants additionally get a volume column sub-pane below the
1476
1529
  // price plot.
1477
1530
  if (spec.chartType === "stock") {
1478
- variant_1 = ((_81 = spec.stockVariant) !== null && _81 !== void 0 ? _81 : "HLC");
1531
+ variant_1 = ((_76 = spec.stockVariant) !== null && _76 !== void 0 ? _76 : "HLC");
1479
1532
  categories = flattenChartDataValues(spec.domains, getDomainValuesFromRange, spec.hiddenDimensionStrategy, false).map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
1480
- seriesValues = ((_82 = spec.series) !== null && _82 !== void 0 ? _82 : []).map(function (seriesEntry) {
1533
+ seriesValues = ((_77 = spec.series) !== null && _77 !== void 0 ? _77 : []).map(function (seriesEntry) {
1481
1534
  return flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
1482
1535
  });
1483
1536
  stockFormats_1 = (0, axis_number_format_1.resolveSeriesNumberFormats)(spec.series, getFormattingFromRange, spec.hiddenDimensionStrategy);
@@ -1495,7 +1548,7 @@ var BasicChart = function (_a) {
1495
1548
  upColor_1 = theme.themeColors.accent1;
1496
1549
  downColor_1 = theme.themeColors.accent2;
1497
1550
  volumePoints = (0, stock_1.toVolumeSeries)(seriesValues, variant_1);
1498
- hasVolume = ((_83 = volumePoints === null || volumePoints === void 0 ? void 0 : volumePoints.length) !== null && _83 !== void 0 ? _83 : 0) > 0;
1551
+ hasVolume = ((_78 = volumePoints === null || volumePoints === void 0 ? void 0 : volumePoints.length) !== null && _78 !== void 0 ? _78 : 0) > 0;
1499
1552
  stockGrid = hasVolume
1500
1553
  ? [
1501
1554
  { left: "10%", right: "4%", top: "8%", height: "56%" },
@@ -1509,7 +1562,7 @@ var BasicChart = function (_a) {
1509
1562
  axisLine: { show: true },
1510
1563
  axisTick: { show: true },
1511
1564
  splitLine: { show: false },
1512
- name: (_84 = spec.horizontalAxisTitle) !== null && _84 !== void 0 ? _84 : "",
1565
+ name: (_79 = spec.horizontalAxisTitle) !== null && _79 !== void 0 ? _79 : "",
1513
1566
  nameLocation: "middle",
1514
1567
  nameGap: 30,
1515
1568
  }, spec.categoryAxisOptions);
@@ -1551,14 +1604,14 @@ var BasicChart = function (_a) {
1551
1604
  // (no open) fall through to the line-derived rendering below.
1552
1605
  if (variant_1 === "OHLC" || variant_1 === "VOHLC") {
1553
1606
  candleData = (0, stock_1.toCandlestick)(seriesValues, variant_1);
1554
- (_85 = chartRef.current) === null || _85 === void 0 ? void 0 : _85.setOption({
1607
+ (_80 = chartRef.current) === null || _80 === void 0 ? void 0 : _80.setOption({
1555
1608
  xAxis: stockXAxis,
1556
1609
  yAxis: tslib_1.__spreadArray([
1557
1610
  (0, overrides_1.applyAxisOverrides)({
1558
1611
  type: "value",
1559
1612
  show: true,
1560
1613
  scale: true,
1561
- name: (_86 = spec.verticalAxisTitle) !== null && _86 !== void 0 ? _86 : "",
1614
+ name: (_81 = spec.verticalAxisTitle) !== null && _81 !== void 0 ? _81 : "",
1562
1615
  nameLocation: "middle",
1563
1616
  nameGap: 50,
1564
1617
  gridIndex: 0,
@@ -1603,13 +1656,13 @@ var BasicChart = function (_a) {
1603
1656
  theme.themeColors.accent3,
1604
1657
  theme.themeColors.accent4,
1605
1658
  ]);
1606
- (_87 = chartRef.current) === null || _87 === void 0 ? void 0 : _87.setOption({
1659
+ (_82 = chartRef.current) === null || _82 === void 0 ? void 0 : _82.setOption({
1607
1660
  xAxis: stockXAxis,
1608
1661
  yAxis: tslib_1.__spreadArray([
1609
1662
  (0, overrides_1.applyAxisOverrides)({
1610
1663
  type: "value",
1611
1664
  show: true,
1612
- name: (_88 = spec.verticalAxisTitle) !== null && _88 !== void 0 ? _88 : "",
1665
+ name: (_83 = spec.verticalAxisTitle) !== null && _83 !== void 0 ? _83 : "",
1613
1666
  nameLocation: "middle",
1614
1667
  nameGap: 50,
1615
1668
  gridIndex: 0,
@@ -1643,19 +1696,24 @@ var BasicChart = function (_a) {
1643
1696
  return [2 /*return*/];
1644
1697
  }
1645
1698
  isStacked = spec.stackedType && spec.stackedType !== "UNSTACKED";
1699
+ axisTextColor = chartTextColor(theme, isDarkMode);
1700
+ axisTextStyle = {
1701
+ axisLabel: { color: axisTextColor, fontSize: overrides_2.CHART_TEXT_PX },
1702
+ nameTextStyle: { color: axisTextColor, fontSize: (0, overrides_2.pointsToPixels)(10) },
1703
+ };
1646
1704
  isCircularChart = spec.chartType === "pie" || spec.chartType === "doughnut";
1647
1705
  isOfPie = isCircularChart && (0, of_pie_1.isOfPieChartSpec)(spec);
1648
1706
  ofPieLayout = null;
1649
1707
  isHorizontalBarChart = spec.chartType === "bar";
1650
1708
  shouldAggregate = (0, aggregation_1.shouldAggregateSeries)(spec.series);
1651
- primaryDomainSource = (_91 = (_90 = (_89 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _89 === void 0 ? void 0 : _89[0]) === null || _90 === void 0 ? void 0 : _90.sources) === null || _91 === void 0 ? void 0 : _91[0];
1709
+ primaryDomainSource = (_86 = (_85 = (_84 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _84 === void 0 ? void 0 : _84[0]) === null || _85 === void 0 ? void 0 : _85.sources) === null || _86 === void 0 ? void 0 : _86[0];
1652
1710
  rawPrimaryDomainValues = primaryDomainSource
1653
- ? (0, aggregation_1.sanitizeDomainValues)((_92 = getDomainValuesFromRange(primaryDomainSource, spec.hiddenDimensionStrategy)) !== null && _92 !== void 0 ? _92 : [])
1711
+ ? (0, aggregation_1.sanitizeDomainValues)((_87 = getDomainValuesFromRange(primaryDomainSource, spec.hiddenDimensionStrategy)) !== null && _87 !== void 0 ? _87 : [])
1654
1712
  : [];
1655
1713
  aggregateDomainValues = (0, aggregation_1.getDomainValuesForAxis)(rawPrimaryDomainValues, shouldAggregate);
1656
1714
  categoryLevels = isCircularChart
1657
1715
  ? undefined
1658
- : (0, category_levels_1.resolveCategoryLevels)((_93 = spec.categoryLevels) === null || _93 === void 0 ? void 0 : _93.map(function (level) {
1716
+ : (0, category_levels_1.resolveCategoryLevels)((_88 = spec.categoryLevels) === null || _88 === void 0 ? void 0 : _88.map(function (level) {
1659
1717
  return flattenChartDataValues([level], getDomainValuesFromRange, spec.hiddenDimensionStrategy, false);
1660
1718
  }));
1661
1719
  if (categoryLevels) {
@@ -1664,17 +1722,17 @@ var BasicChart = function (_a) {
1664
1722
  show: showAxis,
1665
1723
  axisLine: { show: true },
1666
1724
  axisTick: { show: true },
1667
- splitLine: { show: true },
1725
+ splitLine: { show: false },
1668
1726
  name: isHorizontalBarChart
1669
- ? (_94 = spec.verticalAxisTitle) !== null && _94 !== void 0 ? _94 : ""
1670
- : (_95 = spec.horizontalAxisTitle) !== null && _95 !== void 0 ? _95 : "",
1727
+ ? (_89 = spec.verticalAxisTitle) !== null && _89 !== void 0 ? _89 : ""
1728
+ : (_90 = spec.horizontalAxisTitle) !== null && _90 !== void 0 ? _90 : "",
1671
1729
  nameLocation: "middle",
1672
1730
  nameGap: CATEGORY_AXIS_NAME_GAP + 24 * categoryLevels.outer.length,
1673
1731
  })), false));
1674
1732
  }
1675
1733
  // One category axis per domain (Excel): a domain drawn from several
1676
1734
  // ranges lists their categories in sequence on that single axis.
1677
- (categoryLevels ? [] : (_96 = spec.domains) !== null && _96 !== void 0 ? _96 : []).forEach(function (domain, domainIndex) {
1735
+ (categoryLevels ? [] : (_91 = spec.domains) !== null && _91 !== void 0 ? _91 : []).forEach(function (domain, domainIndex) {
1678
1736
  var _a, _b;
1679
1737
  var axisData = domain.sources.flatMap(function (sheetRange, sourceIndex) {
1680
1738
  var _a;
@@ -1689,32 +1747,15 @@ var BasicChart = function (_a) {
1689
1747
  ? (_a = spec.verticalAxisTitle) !== null && _a !== void 0 ? _a : ""
1690
1748
  : (_b = spec.horizontalAxisTitle) !== null && _b !== void 0 ? _b : ""
1691
1749
  : undefined;
1692
- chartDomains.push({
1693
- type: "category",
1694
- data: axisData,
1695
- show: showAxis && !isCircularChart,
1696
- axisLine: { show: !isCircularChart },
1697
- axisTick: { show: !isCircularChart },
1698
- splitLine: { show: !isCircularChart },
1699
- name: axisTitle,
1700
- nameLocation: "middle",
1701
- nameGap: CATEGORY_AXIS_NAME_GAP,
1702
- });
1750
+ chartDomains.push(tslib_1.__assign(tslib_1.__assign({}, axisTextStyle), { type: "category", data: axisData, show: showAxis && !isCircularChart, axisLine: { show: !isCircularChart }, axisTick: { show: !isCircularChart },
1751
+ // Excel draws vertical (category) gridlines only when the axis asks
1752
+ // for them (`<c:catAx><c:majorGridlines/>`) — LV-05.
1753
+ splitLine: { show: false }, name: axisTitle, nameLocation: "middle", nameGap: CATEGORY_AXIS_NAME_GAP }));
1703
1754
  });
1704
1755
  if (chartDomains.length === 0 && !isCircularChart) {
1705
- chartDomains.push({
1706
- type: "category",
1707
- show: showAxis,
1708
- axisLine: { show: true },
1709
- axisTick: { show: true },
1710
- splitLine: { show: true },
1711
- gridIndex: 0,
1712
- name: isHorizontalBarChart
1713
- ? (_97 = spec.verticalAxisTitle) !== null && _97 !== void 0 ? _97 : ""
1714
- : (_98 = spec.horizontalAxisTitle) !== null && _98 !== void 0 ? _98 : "",
1715
- nameLocation: "middle",
1716
- nameGap: CATEGORY_AXIS_NAME_GAP,
1717
- });
1756
+ chartDomains.push(tslib_1.__assign(tslib_1.__assign({}, axisTextStyle), { type: "category", show: showAxis, axisLine: { show: true }, axisTick: { show: true }, splitLine: { show: false }, gridIndex: 0, name: isHorizontalBarChart
1757
+ ? (_92 = spec.verticalAxisTitle) !== null && _92 !== void 0 ? _92 : ""
1758
+ : (_93 = spec.horizontalAxisTitle) !== null && _93 !== void 0 ? _93 : "", nameLocation: "middle", nameGap: CATEGORY_AXIS_NAME_GAP }));
1718
1759
  }
1719
1760
  pushSeriesOverlays = function (series, data, dataLabel) {
1720
1761
  var _a;
@@ -1743,7 +1784,7 @@ var BasicChart = function (_a) {
1743
1784
  };
1744
1785
  sideBySideBarCount = isStacked
1745
1786
  ? 1
1746
- : ((_99 = spec.series) !== null && _99 !== void 0 ? _99 : []).reduce(function (count, s) {
1787
+ : ((_94 = spec.series) !== null && _94 !== void 0 ? _94 : []).reduce(function (count, s) {
1747
1788
  var _a;
1748
1789
  var seriesType = (_a = s.seriesChartType) !== null && _a !== void 0 ? _a : spec.chartType;
1749
1790
  return seriesType === "bar" || seriesType === "column"
@@ -1767,36 +1808,36 @@ var BasicChart = function (_a) {
1767
1808
  return (0, utils_1.chartPaletteColorAt)(seriesPalette, index);
1768
1809
  };
1769
1810
  _loop_1 = function (specSeriesIndex, series) {
1770
- var dataLabel, _189, _190, _191, 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_3, _192, _193, dp, fallback_1, overrides_4, _194, _195, dp, positiveColor_1, negativeColor_1;
1771
- var e_12, _196, e_13, _197, e_14, _198;
1772
- return tslib_1.__generator(this, function (_199) {
1773
- switch (_199.label) {
1811
+ var dataLabel, _184, _185, _186, 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_3, _187, _188, dp, fallback_1, overrides_4, _189, _190, dp, positiveColor_1, negativeColor_1;
1812
+ var e_12, _191, e_13, _192, e_14, _193;
1813
+ return tslib_1.__generator(this, function (_194) {
1814
+ switch (_194.label) {
1774
1815
  case 0:
1775
- if (!((_101 = (0, series_name_1.linkedSeriesName)(series, getDomainValuesFromRange)) !== null && _101 !== void 0)) return [3 /*break*/, 1];
1776
- _189 = _101;
1816
+ if (!((_96 = (0, series_name_1.linkedSeriesName)(series, getDomainValuesFromRange)) !== null && _96 !== void 0)) return [3 /*break*/, 1];
1817
+ _184 = _96;
1777
1818
  return [3 /*break*/, 5];
1778
1819
  case 1:
1779
1820
  if (!(!(0, utils_1.isNil)(series.dataLabel) && (0, utils_1.isAFormula)(series.dataLabel))) return [3 /*break*/, 3];
1780
- _191 = chart_spec_utils_1.coerceCalculatedLabel;
1781
- return [4 /*yield*/, onRequestCalculate(series.dataLabel, (_102 = position.sheetId) !== null && _102 !== void 0 ? _102 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
1821
+ _186 = chart_spec_utils_1.coerceCalculatedLabel;
1822
+ return [4 /*yield*/, onRequestCalculate(series.dataLabel, (_97 = position.sheetId) !== null && _97 !== void 0 ? _97 : sheetId, position.overlayPosition.anchorCell.rowIndex, position.overlayPosition.anchorCell.columnIndex)];
1782
1823
  case 2:
1783
- _190 = _191.apply(void 0, [_199.sent()]);
1824
+ _185 = _186.apply(void 0, [_194.sent()]);
1784
1825
  return [3 /*break*/, 4];
1785
1826
  case 3:
1786
- _190 = (_103 = series.dataLabel) !== null && _103 !== void 0 ? _103 : "";
1787
- _199.label = 4;
1827
+ _185 = (_98 = series.dataLabel) !== null && _98 !== void 0 ? _98 : "";
1828
+ _194.label = 4;
1788
1829
  case 4:
1789
- _189 = (_190);
1790
- _199.label = 5;
1830
+ _184 = (_185);
1831
+ _194.label = 5;
1791
1832
  case 5:
1792
- dataLabel = _189;
1833
+ dataLabel = _184;
1793
1834
  // Label
1794
1835
  if (dataLabel) {
1795
- (_104 = legend.data) === null || _104 === void 0 ? void 0 : _104.push(dataLabel);
1836
+ (_99 = legend.data) === null || _99 === void 0 ? void 0 : _99.push(dataLabel);
1796
1837
  }
1797
- effectiveChartType = (_105 = series.seriesChartType) !== null && _105 !== void 0 ? _105 : spec.chartType;
1838
+ effectiveChartType = (_100 = series.seriesChartType) !== null && _100 !== void 0 ? _100 : spec.chartType;
1798
1839
  lineLike = (0, empty_cells_1.isLineLikeChartType)(effectiveChartType);
1799
- domainSources = (_108 = (_107 = (_106 = spec.domains) === null || _106 === void 0 ? void 0 : _106[0]) === null || _107 === void 0 ? void 0 : _107.sources) !== null && _108 !== void 0 ? _108 : [];
1840
+ domainSources = (_103 = (_102 = (_101 = spec.domains) === null || _101 === void 0 ? void 0 : _101[0]) === null || _102 === void 0 ? void 0 : _102.sources) !== null && _103 !== void 0 ? _103 : [];
1800
1841
  pieDomainLabels = isCircularChart &&
1801
1842
  (domainSources.length > 1 || series.sources.length > 1)
1802
1843
  ? domainSources.flatMap(function (sheetRange) {
@@ -1828,7 +1869,7 @@ var BasicChart = function (_a) {
1828
1869
  seriesEntry = tslib_1.__assign(tslib_1.__assign({ type: seriesEchartsType,
1829
1870
  // Ties the rendered series back to spec.series for click selection
1830
1871
  // One rendered series per spec series (source index 0).
1831
- id: (0, series_click_1.chartSeriesId)(specSeriesIndex, 0), name: dataLabel, data: data, stack: isStacked ? "dataLabel" : undefined, smooth: (_109 = spec.smooth) !== null && _109 !== void 0 ? _109 : undefined, radius: (_110 = spec.radius) !== null && _110 !== void 0 ? _110 : (isCircularChart ? [0, "75%"] : undefined) }, ((0, empty_cells_1.connectsAcrossEmptyCells)(spec, lineLike)
1872
+ id: (0, series_click_1.chartSeriesId)(specSeriesIndex, 0), name: dataLabel, data: data, stack: isStacked ? "dataLabel" : undefined, smooth: (_104 = spec.smooth) !== null && _104 !== void 0 ? _104 : undefined, radius: (_105 = spec.radius) !== null && _105 !== void 0 ? _105 : (isCircularChart ? [0, "75%"] : undefined) }, ((0, empty_cells_1.connectsAcrossEmptyCells)(spec, lineLike)
1832
1873
  ? { connectNulls: true }
1833
1874
  : {})), seriesStyleAttrs);
1834
1875
  // Plot this series against a secondary value axis. The 2nd
@@ -1853,17 +1894,18 @@ var BasicChart = function (_a) {
1853
1894
  }
1854
1895
  seriesAny = series;
1855
1896
  if (effectiveChartType === "line") {
1856
- markerSymbol = (_111 = seriesAny.marker) === null || _111 === void 0 ? void 0 : _111.symbol;
1897
+ markerSymbol = (_106 = seriesAny.marker) === null || _106 === void 0 ? void 0 : _106.symbol;
1857
1898
  wantsMarkers = markerSymbol === "none"
1858
1899
  ? false
1859
1900
  : Boolean(spec.showMarkers) || !(0, utils_1.isNil)(markerSymbol);
1860
1901
  labelsWithoutMarkers = !wantsMarkers &&
1861
- Boolean((_112 = (0, overrides_1.resolveSeriesDataLabels)(spec.dataLabels, seriesAny)) === null || _112 === void 0 ? void 0 : _112.show);
1902
+ Boolean((_107 = (0, overrides_1.resolveSeriesDataLabels)(spec.dataLabels, seriesAny)) === null || _107 === void 0 ? void 0 : _107.show);
1862
1903
  seriesEntry.showSymbol = wantsMarkers || labelsWithoutMarkers;
1863
1904
  if (wantsMarkers) {
1864
1905
  seriesEntry.symbol =
1865
- (_113 = (0, helpers_1.mapMarkerSymbolToEcharts)(markerSymbol)) !== null && _113 !== void 0 ? _113 : "circle";
1866
- seriesEntry.symbolSize = (_115 = (_114 = seriesAny.marker) === null || _114 === void 0 ? void 0 : _114.size) !== null && _115 !== void 0 ? _115 : 6;
1906
+ (_108 = (0, helpers_1.mapMarkerSymbolToEcharts)(markerSymbol !== null && markerSymbol !== void 0 ? markerSymbol : (0, helpers_1.automaticMarkerSymbol)(specSeriesIndex))) !== null && _108 !== void 0 ? _108 : "circle";
1907
+ // Excel's automatic marker is 5 pt (7 px); an authored size is points too.
1908
+ seriesEntry.symbolSize = Math.round((((_110 = (_109 = seriesAny.marker) === null || _109 === void 0 ? void 0 : _109.size) !== null && _110 !== void 0 ? _110 : 5) * 4) / 3);
1867
1909
  }
1868
1910
  else {
1869
1911
  if (labelsWithoutMarkers) {
@@ -1886,7 +1928,7 @@ var BasicChart = function (_a) {
1886
1928
  catch (e_12_1) { e_12 = { error: e_12_1 }; }
1887
1929
  finally {
1888
1930
  try {
1889
- if (isolated_1_1 && !isolated_1_1.done && (_196 = isolated_1.return)) _196.call(isolated_1);
1931
+ if (isolated_1_1 && !isolated_1_1.done && (_191 = isolated_1.return)) _191.call(isolated_1);
1890
1932
  }
1891
1933
  finally { if (e_12) throw e_12.error; }
1892
1934
  }
@@ -1898,9 +1940,9 @@ var BasicChart = function (_a) {
1898
1940
  gradientArgs = (0, gradient_1.gradientToEcharts)(series.gradient);
1899
1941
  if (gradientArgs && !seriesAny.noFill) {
1900
1942
  gradient = new echarts.graphic.LinearGradient(gradientArgs.x, gradientArgs.y, gradientArgs.x2, gradientArgs.y2, gradientArgs.colorStops);
1901
- seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_116 = seriesEntry.itemStyle) !== null && _116 !== void 0 ? _116 : {})), { color: gradient });
1943
+ seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_111 = seriesEntry.itemStyle) !== null && _111 !== void 0 ? _111 : {})), { color: gradient });
1902
1944
  if (effectiveChartType === "area") {
1903
- seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((_117 = seriesEntry.areaStyle) !== null && _117 !== void 0 ? _117 : {})), { color: gradient });
1945
+ seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((_112 = seriesEntry.areaStyle) !== null && _112 !== void 0 ? _112 : {})), { color: gradient });
1904
1946
  }
1905
1947
  }
1906
1948
  else if (seriesAny.noFill) {
@@ -1908,15 +1950,15 @@ var BasicChart = function (_a) {
1908
1950
  // with `transparent` so layout is preserved but nothing
1909
1951
  // paints. Legend entries are also suppressed via `name: ""`
1910
1952
  // since the series carries no semantic information.
1911
- seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_118 = seriesEntry.itemStyle) !== null && _118 !== void 0 ? _118 : {})), { color: "transparent", borderColor: "transparent" });
1953
+ seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_113 = seriesEntry.itemStyle) !== null && _113 !== void 0 ? _113 : {})), { color: "transparent", borderColor: "transparent" });
1912
1954
  }
1913
1955
  else if (isBarOrColumn &&
1914
1956
  Array.isArray(seriesAny.dataPointColors) &&
1915
1957
  seriesAny.dataPointColors.length) {
1916
1958
  overrides_3 = new Map();
1917
1959
  try {
1918
- for (_192 = (e_13 = void 0, tslib_1.__values(seriesAny.dataPointColors)), _193 = _192.next(); !_193.done; _193 = _192.next()) {
1919
- dp = _193.value;
1960
+ for (_187 = (e_13 = void 0, tslib_1.__values(seriesAny.dataPointColors)), _188 = _187.next(); !_188.done; _188 = _187.next()) {
1961
+ dp = _188.value;
1920
1962
  if (typeof dp.idx === "number" && typeof dp.color === "string") {
1921
1963
  overrides_3.set(dp.idx, dp.color);
1922
1964
  }
@@ -1925,20 +1967,20 @@ var BasicChart = function (_a) {
1925
1967
  catch (e_13_1) { e_13 = { error: e_13_1 }; }
1926
1968
  finally {
1927
1969
  try {
1928
- if (_193 && !_193.done && (_197 = _192.return)) _197.call(_192);
1970
+ if (_188 && !_188.done && (_192 = _187.return)) _192.call(_187);
1929
1971
  }
1930
1972
  finally { if (e_13) throw e_13.error; }
1931
1973
  }
1932
- fallback_1 = (_119 = series.color) !== null && _119 !== void 0 ? _119 : paletteColorAt(specSeriesIndex);
1933
- seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_120 = seriesEntry.itemStyle) !== null && _120 !== void 0 ? _120 : {})), { color: function (params) { var _a; return (_a = overrides_3.get(params.dataIndex)) !== null && _a !== void 0 ? _a : fallback_1; } });
1974
+ fallback_1 = (_114 = series.color) !== null && _114 !== void 0 ? _114 : paletteColorAt(specSeriesIndex);
1975
+ seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_115 = seriesEntry.itemStyle) !== null && _115 !== void 0 ? _115 : {})), { color: function (params) { var _a; return (_a = overrides_3.get(params.dataIndex)) !== null && _a !== void 0 ? _a : fallback_1; } });
1934
1976
  }
1935
1977
  else if (isCircularChart &&
1936
1978
  Array.isArray(seriesAny.dataPointColors) &&
1937
1979
  seriesAny.dataPointColors.length) {
1938
1980
  overrides_4 = new Map();
1939
1981
  try {
1940
- for (_194 = (e_14 = void 0, tslib_1.__values(seriesAny.dataPointColors)), _195 = _194.next(); !_195.done; _195 = _194.next()) {
1941
- dp = _195.value;
1982
+ for (_189 = (e_14 = void 0, tslib_1.__values(seriesAny.dataPointColors)), _190 = _189.next(); !_190.done; _190 = _189.next()) {
1983
+ dp = _190.value;
1942
1984
  if (typeof dp.idx === "number" && typeof dp.color === "string") {
1943
1985
  overrides_4.set(dp.idx, dp.color);
1944
1986
  }
@@ -1947,19 +1989,19 @@ var BasicChart = function (_a) {
1947
1989
  catch (e_14_1) { e_14 = { error: e_14_1 }; }
1948
1990
  finally {
1949
1991
  try {
1950
- if (_195 && !_195.done && (_198 = _194.return)) _198.call(_194);
1992
+ if (_190 && !_190.done && (_193 = _189.return)) _193.call(_189);
1951
1993
  }
1952
1994
  finally { if (e_14) throw e_14.error; }
1953
1995
  }
1954
- seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_121 = seriesEntry.itemStyle) !== null && _121 !== void 0 ? _121 : {})), { color: function (params) {
1996
+ seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_116 = seriesEntry.itemStyle) !== null && _116 !== void 0 ? _116 : {})), { color: function (params) {
1955
1997
  var _a, _b;
1956
1998
  return (_b = (_a = overrides_4.get(params.dataIndex)) !== null && _a !== void 0 ? _a : series.color) !== null && _b !== void 0 ? _b : paletteColorAt(params.dataIndex);
1957
1999
  } });
1958
2000
  }
1959
2001
  else if (isBarOrColumn && series.invertIfNegative) {
1960
- positiveColor_1 = (_122 = series.color) !== null && _122 !== void 0 ? _122 : paletteColorAt(specSeriesIndex);
1961
- negativeColor_1 = (_123 = series.negativeColor) !== null && _123 !== void 0 ? _123 : "#FF0000";
1962
- seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_124 = seriesEntry.itemStyle) !== null && _124 !== void 0 ? _124 : {})), { color: function (params) {
2002
+ positiveColor_1 = (_117 = series.color) !== null && _117 !== void 0 ? _117 : paletteColorAt(specSeriesIndex);
2003
+ negativeColor_1 = (_118 = series.negativeColor) !== null && _118 !== void 0 ? _118 : "#FF0000";
2004
+ seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_119 = seriesEntry.itemStyle) !== null && _119 !== void 0 ? _119 : {})), { color: function (params) {
1963
2005
  var _a, _b;
1964
2006
  var value = Array.isArray(params.data)
1965
2007
  ? params.data[1]
@@ -1970,10 +2012,10 @@ var BasicChart = function (_a) {
1970
2012
  } });
1971
2013
  }
1972
2014
  else if (series.color) {
1973
- seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_125 = seriesEntry.itemStyle) !== null && _125 !== void 0 ? _125 : {})), { color: series.color });
1974
- seriesEntry.lineStyle = tslib_1.__assign(tslib_1.__assign({}, ((_126 = seriesEntry.lineStyle) !== null && _126 !== void 0 ? _126 : {})), { color: series.color });
2015
+ seriesEntry.itemStyle = tslib_1.__assign(tslib_1.__assign({}, ((_120 = seriesEntry.itemStyle) !== null && _120 !== void 0 ? _120 : {})), { color: series.color });
2016
+ seriesEntry.lineStyle = tslib_1.__assign(tslib_1.__assign({}, ((_121 = seriesEntry.lineStyle) !== null && _121 !== void 0 ? _121 : {})), { color: series.color });
1975
2017
  if (effectiveChartType === "area") {
1976
- seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((_127 = seriesEntry.areaStyle) !== null && _127 !== void 0 ? _127 : {})), { color: series.color });
2018
+ seriesEntry.areaStyle = tslib_1.__assign(tslib_1.__assign({}, ((_122 = seriesEntry.areaStyle) !== null && _122 !== void 0 ? _122 : {})), { color: series.color });
1977
2019
  }
1978
2020
  }
1979
2021
  chartSeries.push(seriesEntry);
@@ -1982,33 +2024,33 @@ var BasicChart = function (_a) {
1982
2024
  }
1983
2025
  });
1984
2026
  };
1985
- _188.label = 35;
1986
- case 35:
1987
- _188.trys.push([35, 40, 41, 42]);
1988
- _t = tslib_1.__values(((_100 = spec.series) !== null && _100 !== void 0 ? _100 : []).entries()), _u = _t.next();
1989
- _188.label = 36;
1990
- case 36:
1991
- if (!!_u.done) return [3 /*break*/, 39];
2027
+ _182.label = 39;
2028
+ case 39:
2029
+ _182.trys.push([39, 44, 45, 46]);
2030
+ _t = tslib_1.__values(((_95 = spec.series) !== null && _95 !== void 0 ? _95 : []).entries()), _u = _t.next();
2031
+ _182.label = 40;
2032
+ case 40:
2033
+ if (!!_u.done) return [3 /*break*/, 43];
1992
2034
  _v = tslib_1.__read(_u.value, 2), specSeriesIndex = _v[0], series = _v[1];
1993
2035
  return [5 /*yield**/, _loop_1(specSeriesIndex, series)];
1994
- case 37:
1995
- _188.sent();
1996
- _188.label = 38;
1997
- case 38:
2036
+ case 41:
2037
+ _182.sent();
2038
+ _182.label = 42;
2039
+ case 42:
1998
2040
  _u = _t.next();
1999
- return [3 /*break*/, 36];
2000
- case 39: return [3 /*break*/, 42];
2001
- case 40:
2002
- e_3_1 = _188.sent();
2041
+ return [3 /*break*/, 40];
2042
+ case 43: return [3 /*break*/, 46];
2043
+ case 44:
2044
+ e_3_1 = _182.sent();
2003
2045
  e_3 = { error: e_3_1 };
2004
- return [3 /*break*/, 42];
2005
- case 41:
2046
+ return [3 /*break*/, 46];
2047
+ case 45:
2006
2048
  try {
2007
2049
  if (_u && !_u.done && (_6 = _t.return)) _6.call(_t);
2008
2050
  }
2009
2051
  finally { if (e_3) throw e_3.error; }
2010
2052
  return [7 /*endfinally*/];
2011
- case 42:
2053
+ case 46:
2012
2054
  if (isCircularChart && !isOfPie) {
2013
2055
  // Excel's pie / doughnut legend lists the categories, one entry per
2014
2056
  // slice — not the series name (the loop above collected those). The
@@ -2017,7 +2059,7 @@ var BasicChart = function (_a) {
2017
2059
  }
2018
2060
  if (isOfPie) {
2019
2061
  labels = rawPrimaryDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
2020
- seriesEntry = (_128 = spec.series) === null || _128 === void 0 ? void 0 : _128[0];
2062
+ seriesEntry = (_123 = spec.series) === null || _123 === void 0 ? void 0 : _123[0];
2021
2063
  rawValues = seriesEntry
2022
2064
  ? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); })
2023
2065
  : [];
@@ -2064,7 +2106,7 @@ var BasicChart = function (_a) {
2064
2106
  };
2065
2107
  chartSeries.push({
2066
2108
  type: "pie",
2067
- name: (_129 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _129 !== void 0 ? _129 : "",
2109
+ name: (_124 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _124 !== void 0 ? _124 : "",
2068
2110
  center: ["".concat(MAIN_CX_1 * 100, "%"), "".concat(CY_1 * 100, "%")],
2069
2111
  radius: [0, "".concat(MAIN_RADIUS_PCT_1, "%")],
2070
2112
  // Rotate the pie so the "Other" slice's angular midpoint faces
@@ -2082,7 +2124,7 @@ var BasicChart = function (_a) {
2082
2124
  if (ofPieType_1 === "pie") {
2083
2125
  chartSeries.push({
2084
2126
  type: "pie",
2085
- name: (_130 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _130 !== void 0 ? _130 : "",
2127
+ name: (_125 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _125 !== void 0 ? _125 : "",
2086
2128
  center: ["".concat(SECONDARY_CX_1 * 100, "%"), "".concat(CY_1 * 100, "%")],
2087
2129
  radius: [0, "".concat(secondaryRadiusPct_1, "%")],
2088
2130
  data: secondary.map(function (s, i) { return ({
@@ -2177,16 +2219,16 @@ var BasicChart = function (_a) {
2177
2219
  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);
2178
2220
  }
2179
2221
  else if (spec.chartType === "waterfall") {
2180
- primaryDomainSource_1 = (_133 = (_132 = (_131 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _131 === void 0 ? void 0 : _131[0]) === null || _132 === void 0 ? void 0 : _132.sources) === null || _133 === void 0 ? void 0 : _133[0];
2222
+ primaryDomainSource_1 = (_128 = (_127 = (_126 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _126 === void 0 ? void 0 : _126[0]) === null || _127 === void 0 ? void 0 : _127.sources) === null || _128 === void 0 ? void 0 : _128[0];
2181
2223
  rawDomainValues = primaryDomainSource_1
2182
- ? (0, aggregation_1.sanitizeDomainValues)((_134 = getDomainValuesFromRange(primaryDomainSource_1, spec.hiddenDimensionStrategy)) !== null && _134 !== void 0 ? _134 : [])
2224
+ ? (0, aggregation_1.sanitizeDomainValues)((_129 = getDomainValuesFromRange(primaryDomainSource_1, spec.hiddenDimensionStrategy)) !== null && _129 !== void 0 ? _129 : [])
2183
2225
  : [];
2184
2226
  labels = rawDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
2185
- seriesEntry = (_135 = spec.series) === null || _135 === void 0 ? void 0 : _135[0];
2227
+ seriesEntry = (_130 = spec.series) === null || _130 === void 0 ? void 0 : _130[0];
2186
2228
  rawValues_1 = seriesEntry
2187
2229
  ? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); })
2188
2230
  : [];
2189
- totalIndices = new Set((_136 = spec.totalIndices) !== null && _136 !== void 0 ? _136 : []);
2231
+ totalIndices = new Set((_131 = spec.totalIndices) !== null && _131 !== void 0 ? _131 : []);
2190
2232
  steps = (0, waterfall_1.computeWaterfall)(rawValues_1, labels, totalIndices);
2191
2233
  chartDomains.length = 0;
2192
2234
  chartDomains.push({
@@ -2196,7 +2238,7 @@ var BasicChart = function (_a) {
2196
2238
  axisLine: { show: true },
2197
2239
  axisTick: { show: true },
2198
2240
  splitLine: { show: false },
2199
- name: (_137 = spec.horizontalAxisTitle) !== null && _137 !== void 0 ? _137 : "",
2241
+ name: (_132 = spec.horizontalAxisTitle) !== null && _132 !== void 0 ? _132 : "",
2200
2242
  nameLocation: "middle",
2201
2243
  nameGap: 30,
2202
2244
  });
@@ -2213,12 +2255,12 @@ var BasicChart = function (_a) {
2213
2255
  label: { show: false },
2214
2256
  tooltip: { show: false },
2215
2257
  });
2216
- accent_1 = (_138 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _138 !== void 0 ? _138 : theme.themeColors.accent1;
2217
- decreaseColor_1 = (_140 = (_139 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.negativeColor) !== null && _139 !== void 0 ? _139 : theme.themeColors.accent2) !== null && _140 !== void 0 ? _140 : accent_1;
2218
- totalColor_1 = (_141 = theme.themeColors.accent3) !== null && _141 !== void 0 ? _141 : accent_1;
2258
+ accent_1 = (_133 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _133 !== void 0 ? _133 : theme.themeColors.accent1;
2259
+ decreaseColor_1 = (_135 = (_134 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.negativeColor) !== null && _134 !== void 0 ? _134 : theme.themeColors.accent2) !== null && _135 !== void 0 ? _135 : accent_1;
2260
+ totalColor_1 = (_136 = theme.themeColors.accent3) !== null && _136 !== void 0 ? _136 : accent_1;
2219
2261
  pointColors_1 = new Map();
2220
2262
  try {
2221
- for (_x = tslib_1.__values((_142 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataPointColors) !== null && _142 !== void 0 ? _142 : []), _y = _x.next(); !_y.done; _y = _x.next()) {
2263
+ for (_x = tslib_1.__values((_137 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataPointColors) !== null && _137 !== void 0 ? _137 : []), _y = _x.next(); !_y.done; _y = _x.next()) {
2222
2264
  dp = _y.value;
2223
2265
  if (typeof (dp === null || dp === void 0 ? void 0 : dp.idx) === "number" && typeof (dp === null || dp === void 0 ? void 0 : dp.color) === "string") {
2224
2266
  pointColors_1.set(dp.idx, dp.color);
@@ -2240,7 +2282,7 @@ var BasicChart = function (_a) {
2240
2282
  type: "bar",
2241
2283
  id: (0, series_click_1.chartSeriesId)(0, 0),
2242
2284
  stack: "waterfall",
2243
- name: (_143 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _143 !== void 0 ? _143 : "",
2285
+ name: (_138 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _138 !== void 0 ? _138 : "",
2244
2286
  // A bar's height is the step's magnitude; the signed source value
2245
2287
  // rides along as `originalValue` so labels and tooltips read
2246
2288
  // "-90" for a decrease, like Excel.
@@ -2274,12 +2316,12 @@ var BasicChart = function (_a) {
2274
2316
  legend.data = [];
2275
2317
  }
2276
2318
  else if (spec.chartType === "funnel") {
2277
- primaryDomainSource_2 = (_146 = (_145 = (_144 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _144 === void 0 ? void 0 : _144[0]) === null || _145 === void 0 ? void 0 : _145.sources) === null || _146 === void 0 ? void 0 : _146[0];
2319
+ primaryDomainSource_2 = (_141 = (_140 = (_139 = spec === null || spec === void 0 ? void 0 : spec.domains) === null || _139 === void 0 ? void 0 : _139[0]) === null || _140 === void 0 ? void 0 : _140.sources) === null || _141 === void 0 ? void 0 : _141[0];
2278
2320
  rawDomainValues = primaryDomainSource_2
2279
- ? (0, aggregation_1.sanitizeDomainValues)((_147 = getDomainValuesFromRange(primaryDomainSource_2, spec.hiddenDimensionStrategy)) !== null && _147 !== void 0 ? _147 : [])
2321
+ ? (0, aggregation_1.sanitizeDomainValues)((_142 = getDomainValuesFromRange(primaryDomainSource_2, spec.hiddenDimensionStrategy)) !== null && _142 !== void 0 ? _142 : [])
2280
2322
  : [];
2281
2323
  labels_1 = rawDomainValues.map(function (v) { return String(v !== null && v !== void 0 ? v : ""); });
2282
- seriesEntry = (_148 = spec.series) === null || _148 === void 0 ? void 0 : _148[0];
2324
+ seriesEntry = (_143 = spec.series) === null || _143 === void 0 ? void 0 : _143[0];
2283
2325
  rawValues = seriesEntry
2284
2326
  ? flattenChartDataValues([seriesEntry], getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : 0); })
2285
2327
  : [];
@@ -2293,10 +2335,10 @@ var BasicChart = function (_a) {
2293
2335
  theme.themeColors.accent5,
2294
2336
  theme.themeColors.accent6,
2295
2337
  ]);
2296
- funnelColor_1 = (_149 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _149 !== void 0 ? _149 : (0, utils_1.chartPaletteColorAt)(funnelPalette, 0);
2338
+ funnelColor_1 = (_144 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.color) !== null && _144 !== void 0 ? _144 : (0, utils_1.chartPaletteColorAt)(funnelPalette, 0);
2297
2339
  stageColors_1 = new Map();
2298
2340
  try {
2299
- for (_z = tslib_1.__values((_150 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataPointColors) !== null && _150 !== void 0 ? _150 : []), _0 = _z.next(); !_0.done; _0 = _z.next()) {
2341
+ for (_z = tslib_1.__values((_145 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataPointColors) !== null && _145 !== void 0 ? _145 : []), _0 = _z.next(); !_0.done; _0 = _z.next()) {
2300
2342
  dp = _0.value;
2301
2343
  if (typeof (dp === null || dp === void 0 ? void 0 : dp.idx) === "number" && typeof (dp === null || dp === void 0 ? void 0 : dp.color) === "string") {
2302
2344
  stageColors_1.set(dp.idx, dp.color);
@@ -2324,9 +2366,9 @@ var BasicChart = function (_a) {
2324
2366
  top: 60,
2325
2367
  bottom: 20,
2326
2368
  };
2327
- funnelLabelsOff = ((_151 = (0, overrides_1.resolveSeriesDataLabels)(spec.dataLabels, seriesEntry)) === null || _151 === void 0 ? void 0 : _151.show) ===
2369
+ funnelLabelsOff = ((_146 = (0, overrides_1.resolveSeriesDataLabels)(spec.dataLabels, seriesEntry)) === null || _146 === void 0 ? void 0 : _146.show) ===
2328
2370
  false;
2329
- chartSeries.push(tslib_1.__assign(tslib_1.__assign({ type: "funnel", id: (0, series_click_1.chartSeriesId)(0, 0), name: (_152 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _152 !== void 0 ? _152 : "", data: funnelData }, funnelLayout), { itemStyle: {
2371
+ chartSeries.push(tslib_1.__assign(tslib_1.__assign({ type: "funnel", id: (0, series_click_1.chartSeriesId)(0, 0), name: (_147 = seriesEntry === null || seriesEntry === void 0 ? void 0 : seriesEntry.dataLabel) !== null && _147 !== void 0 ? _147 : "", data: funnelData }, funnelLayout), { itemStyle: {
2330
2372
  color: function (params) { var _a; return (_a = stageColors_1.get(params.dataIndex)) !== null && _a !== void 0 ? _a : funnelColor_1; },
2331
2373
  }, label: funnelLabelsOff
2332
2374
  ? { show: false }
@@ -2349,9 +2391,9 @@ var BasicChart = function (_a) {
2349
2391
  showMeanMarker_1 = spec.showMeanMarker === true;
2350
2392
  showInnerPoints_1 = spec.showInnerPoints === true;
2351
2393
  showMeanLine_1 = spec.showMeanLine === true;
2352
- boxDomainSource = (_155 = (_154 = (_153 = spec.domains) === null || _153 === void 0 ? void 0 : _153[0]) === null || _154 === void 0 ? void 0 : _154.sources) === null || _155 === void 0 ? void 0 : _155[0];
2394
+ boxDomainSource = (_150 = (_149 = (_148 = spec.domains) === null || _148 === void 0 ? void 0 : _148[0]) === null || _149 === void 0 ? void 0 : _149.sources) === null || _150 === void 0 ? void 0 : _150[0];
2353
2395
  boxCategories_2 = boxDomainSource
2354
- ? ((_156 = getDomainValuesFromRange(boxDomainSource, spec.hiddenDimensionStrategy)) !== null && _156 !== void 0 ? _156 : []).map(function (v) { return (v === null || v === undefined ? "" : "".concat(v).trim()); })
2396
+ ? ((_151 = getDomainValuesFromRange(boxDomainSource, spec.hiddenDimensionStrategy)) !== null && _151 !== void 0 ? _151 : []).map(function (v) { return (v === null || v === undefined ? "" : "".concat(v).trim()); })
2355
2397
  : [];
2356
2398
  grouped_1 = boxCategories_2.some(function (c) { return c !== ""; });
2357
2399
  groups_1 = [];
@@ -2371,7 +2413,7 @@ var BasicChart = function (_a) {
2371
2413
  finally { if (e_8) throw e_8.error; }
2372
2414
  }
2373
2415
  }
2374
- boxSeriesSpecs = (_157 = spec.series) !== null && _157 !== void 0 ? _157 : [];
2416
+ boxSeriesSpecs = (_152 = spec.series) !== null && _152 !== void 0 ? _152 : [];
2375
2417
  slots = grouped_1 ? groups_1 : ["1"];
2376
2418
  boxGap = typeof spec.gapWidth === "number" ? Math.max(0, spec.gapWidth) : 150;
2377
2419
  boxPlotWidth = Math.max(0, (width !== null && width !== void 0 ? width : 0) * 0.85 - 40);
@@ -2394,7 +2436,7 @@ var BasicChart = function (_a) {
2394
2436
  axisLine: { show: true },
2395
2437
  axisTick: { show: true },
2396
2438
  splitLine: { show: false },
2397
- name: (_158 = spec.horizontalAxisTitle) !== null && _158 !== void 0 ? _158 : "",
2439
+ name: (_153 = spec.horizontalAxisTitle) !== null && _153 !== void 0 ? _153 : "",
2398
2440
  nameLocation: "middle",
2399
2441
  nameGap: 30,
2400
2442
  });
@@ -2522,12 +2564,12 @@ var BasicChart = function (_a) {
2522
2564
  }
2523
2565
  else if (spec.chartType === "histogram") {
2524
2566
  rawValues = flattenChartDataValues(spec.series, getSeriesValuesFromRange, spec.hiddenDimensionStrategy).map(function (v) { return (typeof v === "number" ? v : Number(v)); });
2525
- histogramDomainSource = (_161 = (_160 = (_159 = spec.domains) === null || _159 === void 0 ? void 0 : _159[0]) === null || _160 === void 0 ? void 0 : _160.sources) === null || _161 === void 0 ? void 0 : _161[0];
2567
+ histogramDomainSource = (_156 = (_155 = (_154 = spec.domains) === null || _154 === void 0 ? void 0 : _154[0]) === null || _155 === void 0 ? void 0 : _155.sources) === null || _156 === void 0 ? void 0 : _156[0];
2526
2568
  histogramCategories = histogramDomainSource
2527
- ? ((_162 = getDomainValuesFromRange(histogramDomainSource, spec.hiddenDimensionStrategy)) !== null && _162 !== void 0 ? _162 : [])
2569
+ ? ((_157 = getDomainValuesFromRange(histogramDomainSource, spec.hiddenDimensionStrategy)) !== null && _157 !== void 0 ? _157 : [])
2528
2570
  : [];
2529
2571
  _1 = histogramCategories.length
2530
- ? (0, histogram_1.aggregateByCategory)(histogramCategories, rawValues, (_165 = (_164 = (_163 = spec.series) === null || _163 === void 0 ? void 0 : _163[0]) === null || _164 === void 0 ? void 0 : _164.aggregateType) !== null && _165 !== void 0 ? _165 : "SUM")
2572
+ ? (0, histogram_1.aggregateByCategory)(histogramCategories, rawValues, (_160 = (_159 = (_158 = spec.series) === null || _158 === void 0 ? void 0 : _158[0]) === null || _159 === void 0 ? void 0 : _159.aggregateType) !== null && _160 !== void 0 ? _160 : "SUM")
2531
2573
  : (0, histogram_1.binHistogram)(rawValues, spec.binCount, {
2532
2574
  binSize: spec.binSize,
2533
2575
  intervalClosed: spec.intervalClosed,
@@ -2550,20 +2592,20 @@ var BasicChart = function (_a) {
2550
2592
  axisLine: { show: true },
2551
2593
  axisTick: { show: true },
2552
2594
  splitLine: { show: false },
2553
- name: (_166 = spec.horizontalAxisTitle) !== null && _166 !== void 0 ? _166 : "",
2595
+ name: (_161 = spec.horizontalAxisTitle) !== null && _161 !== void 0 ? _161 : "",
2554
2596
  nameLocation: "middle",
2555
2597
  nameGap: 30,
2556
2598
  });
2557
2599
  chartSeries.length = 0;
2558
2600
  histogramSeries = {
2559
2601
  type: "bar",
2560
- name: (_169 = (_168 = (_167 = spec.series) === null || _167 === void 0 ? void 0 : _167[0]) === null || _168 === void 0 ? void 0 : _168.dataLabel) !== null && _169 !== void 0 ? _169 : "",
2602
+ name: (_164 = (_163 = (_162 = spec.series) === null || _162 === void 0 ? void 0 : _162[0]) === null || _163 === void 0 ? void 0 : _163.dataLabel) !== null && _164 !== void 0 ? _164 : "",
2561
2603
  data: counts,
2562
2604
  // Excel's histogram columns touch unless `gapWidth` says otherwise
2563
2605
  // (#1087); the gap maps like a column chart's.
2564
- barCategoryGap: (_171 = (0, bar_layout_1.gapWidthToBarCategoryGap)((_170 = spec.gapWidth) !== null && _170 !== void 0 ? _170 : 0, { seriesCount: 1 })) !== null && _171 !== void 0 ? _171 : "0%",
2606
+ barCategoryGap: (_166 = (0, bar_layout_1.gapWidthToBarCategoryGap)((_165 = spec.gapWidth) !== null && _165 !== void 0 ? _165 : 0, { seriesCount: 1 })) !== null && _166 !== void 0 ? _166 : "0%",
2565
2607
  };
2566
- histogramColor = (_173 = (_172 = spec.series) === null || _172 === void 0 ? void 0 : _172[0]) === null || _173 === void 0 ? void 0 : _173.color;
2608
+ histogramColor = (_168 = (_167 = spec.series) === null || _167 === void 0 ? void 0 : _167[0]) === null || _168 === void 0 ? void 0 : _168.color;
2567
2609
  if (histogramColor) {
2568
2610
  histogramSeries.itemStyle = { color: histogramColor };
2569
2611
  }
@@ -2579,40 +2621,53 @@ var BasicChart = function (_a) {
2579
2621
  }
2580
2622
  legend.data = [];
2581
2623
  }
2582
- renderedSeriesCount = chartSeries.length;
2624
+ lineElementOptions = spec;
2625
+ if (!isCircularChart &&
2626
+ (lineElementOptions.dropLines ||
2627
+ (spec.chartType === "line" &&
2628
+ (lineElementOptions.hiLowLines || lineElementOptions.upDownBars)))) {
2629
+ lineData = chartSeries
2630
+ .filter(function (s) {
2631
+ return (s === null || s === void 0 ? void 0 : s.type) === "line" &&
2632
+ s.yAxisIndex !== 1 &&
2633
+ (0, series_click_1.chartSeriesSpecIndex)(s.id) !== undefined &&
2634
+ Array.isArray(s.data);
2635
+ })
2636
+ .map(function (s) { return s.data; });
2637
+ chartSeries.push.apply(chartSeries, tslib_1.__spreadArray([], tslib_1.__read((0, chart_lines_1.buildChartLineSeries)({
2638
+ dropLines: lineElementOptions.dropLines &&
2639
+ (spec.chartType === "line" || spec.chartType === "area"),
2640
+ hiLowLines: lineElementOptions.hiLowLines,
2641
+ upDownBars: lineElementOptions.upDownBars,
2642
+ }, lineData, { isDarkMode: isDarkMode })), false));
2643
+ }
2644
+ renderedSeriesCount = chartSeries.length + (spec.dataTable ? 10000 : 0);
2583
2645
  replaceMerge = previousChartType.current !== spec.chartType ||
2584
2646
  previousSeriesCount.current !== renderedSeriesCount
2585
2647
  ? ["series", "xAxis", "yAxis", "legend", "grid", "tooltip"]
2586
2648
  : [];
2587
- valueAxisBase = {
2588
- type: "value",
2589
- show: !isCircularChart,
2649
+ valueAxisBase = tslib_1.__assign(tslib_1.__assign({}, axisTextStyle), { type: "value", show: !isCircularChart,
2590
2650
  // echarts draws the value axis line at the zero of a value-type x
2591
2651
  // axis in the grid; the box & whisker overlay axis (#1099) would pull
2592
2652
  // it into the first category's slot, so it stays at the plot edge.
2593
- axisLine: tslib_1.__assign({ show: !isCircularChart }, (boxplotOverlayAxis ? { onZero: false } : {})),
2594
- axisTick: { show: !isCircularChart },
2595
- splitLine: { show: !isCircularChart },
2596
- nameLocation: "middle",
2597
- nameGap: 50,
2598
- };
2653
+ axisLine: tslib_1.__assign({ show: !isCircularChart }, (boxplotOverlayAxis ? { onZero: false } : {})), axisTick: { show: !isCircularChart }, splitLine: { show: !isCircularChart }, nameLocation: "middle", nameGap: 50 });
2599
2654
  isPareto = spec.chartType === "histogram" && (0, histogram_1.isParetoSpec)(spec);
2600
2655
  hasSecondaryAxis = !isCircularChart &&
2601
2656
  !isHorizontalBarChart &&
2602
- (((_174 = spec.series) !== null && _174 !== void 0 ? _174 : []).some(function (s) { return s.useSecondaryAxis; }) || isPareto);
2657
+ (((_169 = spec.series) !== null && _169 !== void 0 ? _169 : []).some(function (s) { return s.useSecondaryAxis; }) || isPareto);
2603
2658
  isPercentStackedBars = spec.stackedType === "PERCENT_STACKED" &&
2604
2659
  (spec.chartType === "bar" || spec.chartType === "column");
2605
2660
  primaryAxisNumberFormat = isPercentStackedBars
2606
2661
  ? undefined
2607
2662
  : (0, axis_number_format_1.resolveValueAxisNumberFormat)({
2608
2663
  axisOptions: spec.valueAxisOptions,
2609
- series: ((_175 = spec.series) !== null && _175 !== void 0 ? _175 : []).filter(function (s) { return !s.useSecondaryAxis; }),
2664
+ series: ((_170 = spec.series) !== null && _170 !== void 0 ? _170 : []).filter(function (s) { return !s.useSecondaryAxis; }),
2610
2665
  getFormattingFromRange: getFormattingFromRange,
2611
2666
  hiddenDimensionStrategy: spec.hiddenDimensionStrategy,
2612
2667
  });
2613
2668
  secondaryAxisNumberFormat = (0, axis_number_format_1.resolveValueAxisNumberFormat)({
2614
2669
  axisOptions: spec.secondaryValueAxisOptions,
2615
- series: ((_176 = spec.series) !== null && _176 !== void 0 ? _176 : []).filter(function (s) { return s.useSecondaryAxis; }),
2670
+ series: ((_171 = spec.series) !== null && _171 !== void 0 ? _171 : []).filter(function (s) { return s.useSecondaryAxis; }),
2616
2671
  getFormattingFromRange: getFormattingFromRange,
2617
2672
  hiddenDimensionStrategy: spec.hiddenDimensionStrategy,
2618
2673
  });
@@ -2641,17 +2696,17 @@ var BasicChart = function (_a) {
2641
2696
  finalLegend = (0, overrides_1.applyLegendOverrides)(legend, spec.legend);
2642
2697
  bottomAxisNameGap = isHorizontalBarChart
2643
2698
  ? valueAxisBase.nameGap
2644
- : Number((_178 = (_177 = chartDomains[0]) === null || _177 === void 0 ? void 0 : _177.nameGap) !== null && _178 !== void 0 ? _178 : CATEGORY_AXIS_NAME_GAP);
2699
+ : Number((_173 = (_172 = chartDomains[0]) === null || _172 === void 0 ? void 0 : _172.nameGap) !== null && _173 !== void 0 ? _173 : CATEGORY_AXIS_NAME_GAP);
2645
2700
  legendBand = (0, legend_layout_1.reserveEchartsLegendBand)({
2646
- position: (_179 = spec.legend) === null || _179 === void 0 ? void 0 : _179.position,
2701
+ position: (_174 = spec.legend) === null || _174 === void 0 ? void 0 : _174.position,
2647
2702
  visible: finalLegend.show !== false,
2648
2703
  labels: (0, legend_layout_1.legendLabelsFrom)(finalLegend.data, chartSeries.map(function (s) { return s === null || s === void 0 ? void 0 : s.name; })),
2649
- legendFontSize: (_184 = (_181 = (_180 = finalLegend.textStyle) === null || _180 === void 0 ? void 0 : _180.fontSize) !== null && _181 !== void 0 ? _181 : (_183 = (_182 = spec.legend) === null || _182 === void 0 ? void 0 : _182.textFormat) === null || _183 === void 0 ? void 0 : _183.fontSize) !== null && _184 !== void 0 ? _184 : 12,
2704
+ legendFontSize: (_176 = (_175 = finalLegend.textStyle) === null || _175 === void 0 ? void 0 : _175.fontSize) !== null && _176 !== void 0 ? _176 : (0, overrides_2.fontSizePx)((_178 = (_177 = spec.legend) === null || _177 === void 0 ? void 0 : _177.textFormat) === null || _178 === void 0 ? void 0 : _178.fontSize, overrides_2.CHART_TEXT_PX),
2650
2705
  legendItemWidth: defaultLegendConfig.itemWidth,
2651
2706
  width: width !== null && width !== void 0 ? width : 0,
2652
2707
  height: height !== null && height !== void 0 ? height : 0,
2653
2708
  hasTitle: Boolean(title),
2654
- titleFontSize: (_186 = (_185 = spec.titleTextFormat) === null || _185 === void 0 ? void 0 : _185.fontSize) !== null && _186 !== void 0 ? _186 : 16,
2709
+ titleFontSize: (0, overrides_2.fontSizePx)((_179 = spec.titleTextFormat) === null || _179 === void 0 ? void 0 : _179.fontSize, overrides_2.CHART_TITLE_PX),
2655
2710
  hasBottomAxisTitle: !isCircularChart && Boolean(spec.horizontalAxisTitle),
2656
2711
  bottomAxisNameGap: bottomAxisNameGap,
2657
2712
  hasLeftAxisTitle: !isCircularChart && Boolean(spec.verticalAxisTitle),
@@ -2673,11 +2728,15 @@ var BasicChart = function (_a) {
2673
2728
  : legendBand.grid;
2674
2729
  chartDataLabels = spec.dataLabels;
2675
2730
  seriesLabelOptionFor = function (s) {
2676
- var _a;
2731
+ var _a, _b;
2677
2732
  var specIndex = (0, series_click_1.chartSeriesSpecIndex)(s === null || s === void 0 ? void 0 : s.id);
2678
2733
  var dataLabelOptions = (0, overrides_1.resolveSeriesDataLabels)(chartDataLabels, specIndex === undefined ? undefined : (_a = spec.series) === null || _a === void 0 ? void 0 : _a[specIndex]);
2679
- return (0, overrides_1.buildSeriesLabelOption)(dataLabelOptions && !dataLabelOptions.numberFormatPattern
2680
- ? tslib_1.__assign(tslib_1.__assign({}, dataLabelOptions), { numberFormatPattern: seriesNumberFormatFor(s) }) : dataLabelOptions, s === null || s === void 0 ? void 0 : s.type, locale);
2734
+ var withFormat = dataLabelOptions && !dataLabelOptions.numberFormatPattern
2735
+ ? tslib_1.__assign(tslib_1.__assign({}, dataLabelOptions), { numberFormatPattern: seriesNumberFormatFor(s) }) : dataLabelOptions;
2736
+ // Value From Cells: the label range's cells, point by point.
2737
+ var cellRange = withFormat === null || withFormat === void 0 ? void 0 : withFormat.valueFromCells;
2738
+ return (0, overrides_1.buildSeriesLabelOption)(cellRange
2739
+ ? tslib_1.__assign(tslib_1.__assign({}, withFormat), { cellLabels: (_b = getDomainValuesFromRange(cellRange, spec.hiddenDimensionStrategy)) !== null && _b !== void 0 ? _b : [] }) : withFormat, s === null || s === void 0 ? void 0 : s.type, locale);
2681
2740
  };
2682
2741
  isDoughnut = spec.chartType === "doughnut";
2683
2742
  doughnutHoleSize = spec.doughnutHoleSize;
@@ -2755,20 +2814,21 @@ var BasicChart = function (_a) {
2755
2814
  }
2756
2815
  }
2757
2816
  seriesWithLabels = chartSeries.map(function (s) {
2758
- var _a, _b, _c, _d, _e, _f, _g, _h;
2817
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2759
2818
  var next = tslib_1.__assign({}, s);
2760
- if (DECORATION_SERIES_IDS.has(s === null || s === void 0 ? void 0 : s.id)) {
2819
+ if (DECORATION_SERIES_IDS.has(s === null || s === void 0 ? void 0 : s.id) ||
2820
+ String((_a = s === null || s === void 0 ? void 0 : s.id) !== null && _a !== void 0 ? _a : "").startsWith(chart_lines_1.CHART_LINE_SERIES_PREFIX)) {
2761
2821
  return next;
2762
2822
  }
2763
2823
  var seriesLabelOption = seriesLabelOptionFor(s);
2764
2824
  if (seriesLabelOption) {
2765
- next.label = tslib_1.__assign(tslib_1.__assign({}, ((_a = s === null || s === void 0 ? void 0 : s.label) !== null && _a !== void 0 ? _a : {})), seriesLabelOption);
2825
+ next.label = tslib_1.__assign(tslib_1.__assign({}, ((_b = s === null || s === void 0 ? void 0 : s.label) !== null && _b !== void 0 ? _b : {})), seriesLabelOption);
2766
2826
  }
2767
2827
  else if ((s === null || s === void 0 ? void 0 : s.type) === "pie") {
2768
2828
  // echarts labels every pie slice by default (category name on a
2769
2829
  // leader line); Excel draws nothing until data labels are on (#1062).
2770
- next.label = tslib_1.__assign(tslib_1.__assign({}, ((_b = s === null || s === void 0 ? void 0 : s.label) !== null && _b !== void 0 ? _b : {})), { show: false });
2771
- next.labelLine = tslib_1.__assign(tslib_1.__assign({}, ((_c = s === null || s === void 0 ? void 0 : s.labelLine) !== null && _c !== void 0 ? _c : {})), { show: false });
2830
+ next.label = tslib_1.__assign(tslib_1.__assign({}, ((_c = s === null || s === void 0 ? void 0 : s.label) !== null && _c !== void 0 ? _c : {})), { show: false });
2831
+ next.labelLine = tslib_1.__assign(tslib_1.__assign({}, ((_d = s === null || s === void 0 ? void 0 : s.labelLine) !== null && _d !== void 0 ? _d : {})), { show: false });
2772
2832
  }
2773
2833
  // Tooltip values of the value-axis series (a boxplot / candlestick
2774
2834
  // tooltip lists its own statistics and keeps echarts' default).
@@ -2790,14 +2850,14 @@ var BasicChart = function (_a) {
2790
2850
  return item !== null && typeof item === "object" && "originalValue" in item;
2791
2851
  });
2792
2852
  if ((seriesTooltipValueFormatter || carriesOriginalValues) &&
2793
- ((_d = s === null || s === void 0 ? void 0 : s.tooltip) === null || _d === void 0 ? void 0 : _d.show) !== false) {
2853
+ ((_e = s === null || s === void 0 ? void 0 : s.tooltip) === null || _e === void 0 ? void 0 : _e.show) !== false) {
2794
2854
  var formatValue_1 = seriesTooltipValueFormatter !== null && seriesTooltipValueFormatter !== void 0 ? seriesTooltipValueFormatter : (function (value) { return (0, axis_number_format_1.formatAxisValue)(undefined, value, locale); });
2795
- next.tooltip = tslib_1.__assign(tslib_1.__assign({}, ((_e = s === null || s === void 0 ? void 0 : s.tooltip) !== null && _e !== void 0 ? _e : {})), { valueFormatter: function (value, dataIndex) { var _a; return formatValue_1((_a = originalValueAt(dataIndex)) !== null && _a !== void 0 ? _a : value); } });
2855
+ next.tooltip = tslib_1.__assign(tslib_1.__assign({}, ((_f = s === null || s === void 0 ? void 0 : s.tooltip) !== null && _f !== void 0 ? _f : {})), { valueFormatter: function (value, dataIndex) { var _a; return formatValue_1((_a = originalValueAt(dataIndex)) !== null && _a !== void 0 ? _a : value); } });
2796
2856
  }
2797
2857
  if (next.type === "pie") {
2798
2858
  var pieNumberFormat = seriesNumberFormatFor(s);
2799
- if (pieNumberFormat && ((_f = s === null || s === void 0 ? void 0 : s.tooltip) === null || _f === void 0 ? void 0 : _f.show) !== false) {
2800
- next.tooltip = tslib_1.__assign(tslib_1.__assign({}, ((_g = s === null || s === void 0 ? void 0 : s.tooltip) !== null && _g !== void 0 ? _g : {})), { formatter: (0, axis_number_format_1.circularTooltipFormatter)(pieNumberFormat, locale) });
2859
+ if (pieNumberFormat && ((_g = s === null || s === void 0 ? void 0 : s.tooltip) === null || _g === void 0 ? void 0 : _g.show) !== false) {
2860
+ next.tooltip = tslib_1.__assign(tslib_1.__assign({}, ((_h = s === null || s === void 0 ? void 0 : s.tooltip) !== null && _h !== void 0 ? _h : {})), { formatter: (0, axis_number_format_1.circularTooltipFormatter)(pieNumberFormat, locale) });
2801
2861
  }
2802
2862
  if (explosionOffset > 0 && Array.isArray(next.data)) {
2803
2863
  next.selectedMode = "multiple";
@@ -2814,14 +2874,75 @@ var BasicChart = function (_a) {
2814
2874
  // ring edge is its fraction of 75%, not of the whole chart (#1064:
2815
2875
  // Excel's default 0.75 used to meet the outer edge, an empty ring).
2816
2876
  var rank = doughnutSeriesOrder.indexOf((0, series_click_1.chartSeriesSpecIndex)(s === null || s === void 0 ? void 0 : s.id));
2817
- var ring = (_h = doughnutRingSet[rank]) !== null && _h !== void 0 ? _h : (0, doughnut_1.doughnutRings)((0, doughnut_1.clampDoughnutHole)(doughnutHoleSize), 1)[0];
2877
+ var ring = (_j = doughnutRingSet[rank]) !== null && _j !== void 0 ? _j : (0, doughnut_1.doughnutRings)((0, doughnut_1.clampDoughnutHole)(doughnutHoleSize), 1)[0];
2818
2878
  var pct = function (fraction) { return "".concat(Math.round(fraction * 75 * 100) / 100, "%"); };
2819
2879
  next.radius = [pct(ring.inner), pct(ring.outer)];
2820
2880
  }
2821
2881
  return next;
2822
2882
  });
2883
+ bareCategoryAxis = chartDomains[0];
2884
+ if (!isCircularChart &&
2885
+ !categoryLevels &&
2886
+ !((_180 = spec.domains) === null || _180 === void 0 ? void 0 : _180.length) &&
2887
+ bareCategoryAxis &&
2888
+ bareCategoryAxis.data === undefined) {
2889
+ pointCount = seriesWithLabels.reduce(function (count, s) {
2890
+ return ((s === null || s === void 0 ? void 0 : s.type) === "bar" || (s === null || s === void 0 ? void 0 : s.type) === "line") && Array.isArray(s.data)
2891
+ ? Math.max(count, s.data.length)
2892
+ : count;
2893
+ }, 0);
2894
+ bareCategoryAxis.data = Array.from({ length: pointCount }, function (_, i) {
2895
+ return String(i + 1);
2896
+ });
2897
+ }
2898
+ dataTableOptions = spec.dataTable;
2899
+ dataTableRows = dataTableOptions && !isCircularChart && !isHorizontalBarChart && !isOfPie
2900
+ ? seriesWithLabels
2901
+ .filter(function (s) {
2902
+ return ((s === null || s === void 0 ? void 0 : s.type) === "line" || (s === null || s === void 0 ? void 0 : s.type) === "bar") &&
2903
+ (0, series_click_1.chartSeriesSpecIndex)(s === null || s === void 0 ? void 0 : s.id) !== undefined &&
2904
+ Array.isArray(s.data);
2905
+ })
2906
+ .map(function (s) {
2907
+ var _a, _b, _c, _d, _e;
2908
+ var specIndex = (0, series_click_1.chartSeriesSpecIndex)(s.id);
2909
+ var pattern = seriesNumberFormatFor(s);
2910
+ return {
2911
+ name: String((_a = s.name) !== null && _a !== void 0 ? _a : ""),
2912
+ color: typeof ((_b = s.itemStyle) === null || _b === void 0 ? void 0 : _b.color) === "string"
2913
+ ? s.itemStyle.color
2914
+ : (_e = (_d = (_c = spec.series) === null || _c === void 0 ? void 0 : _c[specIndex]) === null || _d === void 0 ? void 0 : _d.color) !== null && _e !== void 0 ? _e : paletteColorAt(specIndex),
2915
+ values: s.data.map(function (d) {
2916
+ var _a;
2917
+ var v = d !== null && typeof d === "object"
2918
+ ? (_a = d.originalValue) !== null && _a !== void 0 ? _a : d.value
2919
+ : d;
2920
+ return v === null || v === undefined ? "" : (0, axis_number_format_1.formatAxisValue)(pattern, v, locale);
2921
+ }),
2922
+ };
2923
+ })
2924
+ : [];
2925
+ dataTableAxisList = dataTableRows.length
2926
+ ? (0, data_table_1.dataTableAxes)(dataTableRows, dataTableOptions !== null && dataTableOptions !== void 0 ? dataTableOptions : {}, {
2927
+ textColor: axisTextColor,
2928
+ fontSize: overrides_2.CHART_TEXT_PX,
2929
+ borderColor: isDarkMode ? "rgba(255,255,255,0.3)" : "#D9D9D9",
2930
+ })
2931
+ : [];
2932
+ autoScaleEligible = !isCircularChart &&
2933
+ !isOfPie &&
2934
+ AUTO_SCALE_CHART_TYPES.has(spec.chartType) &&
2935
+ !spec.sourceChartType &&
2936
+ spec.stackedType !== "PERCENT_STACKED";
2937
+ withExcelAutoScale = function (axis, opts, axisIndex) {
2938
+ if (!autoScaleEligible || (axis === null || axis === void 0 ? void 0 : axis.type) === "log" || (opts === null || opts === void 0 ? void 0 : opts.logarithmic)) {
2939
+ return axis;
2940
+ }
2941
+ var scale = (0, excel_axis_scale_1.excelAutoAxisScale)((0, excel_axis_scale_1.valueAxisExtentValues)(seriesWithLabels, axisIndex), { min: opts === null || opts === void 0 ? void 0 : opts.min, max: opts === null || opts === void 0 ? void 0 : opts.max, majorUnit: opts === null || opts === void 0 ? void 0 : opts.majorUnit });
2942
+ return scale ? tslib_1.__assign(tslib_1.__assign({}, axis), scale) : axis;
2943
+ };
2823
2944
  // Update charts
2824
- (_187 = chartRef.current) === null || _187 === void 0 ? void 0 : _187.setOption({
2945
+ (_181 = chartRef.current) === null || _181 === void 0 ? void 0 : _181.setOption({
2825
2946
  xAxis: (function () {
2826
2947
  var _a, _b;
2827
2948
  if (isOfPie) {
@@ -2865,7 +2986,7 @@ var BasicChart = function (_a) {
2865
2986
  }
2866
2987
  if (isHorizontalBarChart) {
2867
2988
  return [
2868
- (0, overrides_1.applyAxisOverrides)(tslib_1.__assign(tslib_1.__assign({}, valueAxisBase), { name: (_a = spec.horizontalAxisTitle) !== null && _a !== void 0 ? _a : "" }), spec.valueAxisOptions, primaryAxisNumberFormat, locale),
2989
+ withExcelAutoScale((0, overrides_1.applyAxisOverrides)(tslib_1.__assign(tslib_1.__assign({}, valueAxisBase), { name: (_a = spec.horizontalAxisTitle) !== null && _a !== void 0 ? _a : "" }), spec.valueAxisOptions, primaryAxisNumberFormat, locale, "x"), spec.valueAxisOptions, 0),
2869
2990
  ];
2870
2991
  }
2871
2992
  var base = chartDomains.length > 0
@@ -2876,7 +2997,7 @@ var BasicChart = function (_a) {
2876
2997
  show: showAxis,
2877
2998
  axisLine: { show: true },
2878
2999
  axisTick: { show: true },
2879
- splitLine: { show: true },
3000
+ splitLine: { show: false },
2880
3001
  name: (_b = spec.horizontalAxisTitle) !== null && _b !== void 0 ? _b : "",
2881
3002
  nameLocation: "middle",
2882
3003
  nameGap: CATEGORY_AXIS_NAME_GAP,
@@ -2885,7 +3006,7 @@ var BasicChart = function (_a) {
2885
3006
  var axes = base.map(function (axis) {
2886
3007
  return (0, overrides_1.applyAxisOverrides)(axis, spec.categoryAxisOptions);
2887
3008
  });
2888
- return boxplotOverlayAxis ? tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(axes), false), [boxplotOverlayAxis], false) : axes;
3009
+ return tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(axes), false), tslib_1.__read((boxplotOverlayAxis ? [boxplotOverlayAxis] : [])), false), tslib_1.__read(dataTableAxisList), false);
2889
3010
  })(),
2890
3011
  yAxis: (function () {
2891
3012
  var _a, _b;
@@ -2919,14 +3040,14 @@ var BasicChart = function (_a) {
2919
3040
  show: showAxis,
2920
3041
  axisLine: { show: true },
2921
3042
  axisTick: { show: true },
2922
- splitLine: { show: true },
3043
+ splitLine: { show: false },
2923
3044
  name: (_a = spec.verticalAxisTitle) !== null && _a !== void 0 ? _a : "",
2924
3045
  nameLocation: "middle",
2925
3046
  nameGap: CATEGORY_AXIS_NAME_GAP,
2926
3047
  },
2927
3048
  ];
2928
3049
  return base.map(function (axis) {
2929
- return (0, overrides_1.applyAxisOverrides)(axis, spec.categoryAxisOptions);
3050
+ return (0, overrides_1.applyAxisOverrides)(axis, spec.categoryAxisOptions, undefined, undefined, "y");
2930
3051
  });
2931
3052
  }
2932
3053
  var axes = [
@@ -2947,6 +3068,7 @@ var BasicChart = function (_a) {
2947
3068
  locale: locale,
2948
3069
  }) }), spec.valueAxisOptions, primaryAxisNumberFormat, locale),
2949
3070
  ];
3071
+ axes[0] = withExcelAutoScale(axes[0], spec.valueAxisOptions, 0);
2950
3072
  if (hasSecondaryAxis) {
2951
3073
  axes.push((0, overrides_1.applyAxisOverrides)(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, valueAxisBase), { name: "", splitLine: { show: false } }), (isPareto
2952
3074
  ? {
@@ -2955,6 +3077,9 @@ var BasicChart = function (_a) {
2955
3077
  axisLabel: { formatter: "{value}%" },
2956
3078
  }
2957
3079
  : {})), spec.secondaryValueAxisOptions, secondaryAxisNumberFormat, locale));
3080
+ if (!isPareto) {
3081
+ axes[1] = withExcelAutoScale(axes[1], spec.secondaryValueAxisOptions, 1);
3082
+ }
2958
3083
  }
2959
3084
  return axes;
2960
3085
  })(),
@@ -3005,10 +3130,8 @@ var BasicChart = function (_a) {
3005
3130
  var applyThemeOptions = function () {
3006
3131
  var _a, _b, _c, _d;
3007
3132
  if (chartRef.current) {
3008
- var textColor = (0, spreadsheet_1.getStringifiedColor)({
3009
- theme: 1,
3010
- tint: isDarkMode ? 1 : 0,
3011
- }, theme);
3133
+ var textColor = chartTextColor(theme, isDarkMode);
3134
+ var fontFamily = chartFontFamily(theme);
3012
3135
  var bgColor = (0, spreadsheet_1.getStringifiedColor)({ theme: 0, tint: isDarkMode ? -1 : 1 }, theme);
3013
3136
  var showAxis = (0, helpers_1.showXAxis)(chart.spec.chartType);
3014
3137
  // Authored chart-level text formats override the theme-derived
@@ -3024,18 +3147,24 @@ var BasicChart = function (_a) {
3024
3147
  // Every key is written (echarts merges setOption calls, so a key
3025
3148
  // left out keeps its previous value — turning bold off used to
3026
3149
  // leave the title bold, rowsncolumns/spreadsheet#1105).
3150
+ left: "center",
3027
3151
  textStyle: (0, overrides_2.themedTextStyle)(authoredTitleFmt, {
3028
3152
  color: textColor,
3029
- fontSize: 18,
3030
- fontWeight: "bold",
3153
+ fontSize: overrides_2.CHART_TITLE_PX,
3154
+ fontFamily: fontFamily,
3155
+ fontWeight: "normal",
3031
3156
  }),
3032
3157
  },
3033
3158
  legend: {
3034
3159
  textStyle: (0, overrides_2.themedTextStyle)(authoredLegendFmt, {
3035
3160
  color: textColor,
3036
- fontSize: 12,
3161
+ fontSize: overrides_2.CHART_TEXT_PX,
3162
+ fontFamily: fontFamily,
3037
3163
  }),
3038
3164
  },
3165
+ // Every other chart text (tick labels, axis titles, data labels)
3166
+ // inherits the theme body font.
3167
+ textStyle: { fontFamily: fontFamily },
3039
3168
  axisLabel: {
3040
3169
  color: (_c = authoredDataLabelFmt === null || authoredDataLabelFmt === void 0 ? void 0 : authoredDataLabelFmt.color) !== null && _c !== void 0 ? _c : textColor,
3041
3170
  },
@@ -3090,8 +3219,8 @@ var BasicChart = function (_a) {
3090
3219
  chart.spec.palette,
3091
3220
  chart.spec.backgroundColor,
3092
3221
  chart.spec.titleTextFormat,
3093
- (_c = chart.spec.legend) === null || _c === void 0 ? void 0 : _c.textFormat,
3094
- (_d = chart.spec.dataLabels) === null || _d === void 0 ? void 0 : _d.textFormat,
3222
+ (_e = chart.spec.legend) === null || _e === void 0 ? void 0 : _e.textFormat,
3223
+ (_f = chart.spec.dataLabels) === null || _f === void 0 ? void 0 : _f.textFormat,
3095
3224
  ]);
3096
3225
  // Draw chart. `glUpgradeTick` re-runs the draw when the lazily loaded
3097
3226
  // echarts-gl module resolves, upgrading a 3-D spec's immediate 2-D