+ ${[...nodesToShow]
+ .reverse()
+ .map(
+ (node) => `
+
+ ${node.name}
+ ${
+ isContributionMode
+ ? getFormattedContribution(node.val, rootValue)
+ : applyFormat(numberFormatConfig, node.val)
+ }
+
+
+ `,
+ )
+ .join('')}
+
+ ${
+ isContributionMode
+ ? getFormattedContribution(nodesToShow[0].val, rootValue)
+ : applyFormat(numberFormatConfig, nodesToShow[0]?.val)
+ } of ${valueTitle}
+
+
+ ${
+ nodesToShow[1]
+ ? `${getFormattedContribution(
+ nodesToShow[0]?.val,
+ nodesToShow[1]?.val,
+ )}% of ${nodesToShow[1]?.name}`
+ : ''
+ }
+
+
`;
+}
diff --git a/packages/sdk-ui/src/chart-options-processor/translations/treemap/types.ts b/packages/sdk-ui/src/chart-options-processor/translations/treemap/types.ts
new file mode 100644
index 00000000..d11d5096
--- /dev/null
+++ b/packages/sdk-ui/src/chart-options-processor/translations/treemap/types.ts
@@ -0,0 +1,22 @@
+import { Chart, PointLabelObject } from '@sisense/sisense-charts';
+
+export type ParentValues = {
+ direction: number;
+ height: number;
+ val: number;
+ width: number;
+ x: number;
+ y: number;
+};
+
+export type LayoutPointResult = {
+ x: number;
+ y: number;
+ width: number;
+ height: number;
+};
+
+export type TreemapLayoutAlgorithmContext = {
+ chart: Chart;
+ squarified: (parent: ParentValues, children: PointLabelObject[]) => LayoutPointResult[];
+};
diff --git a/packages/sdk-ui/src/chart-options-processor/translations/types.ts b/packages/sdk-ui/src/chart-options-processor/translations/types.ts
index 748398ca..8e286651 100644
--- a/packages/sdk-ui/src/chart-options-processor/translations/types.ts
+++ b/packages/sdk-ui/src/chart-options-processor/translations/types.ts
@@ -10,6 +10,7 @@ import {
IndicatorChartDesignOptions,
PolarChartDesignOptions,
ScatterChartDesignOptions,
+ TreemapChartDesignOptions,
} from './design-options';
export const POLAR_CHART_TYPES = ['polar'] as const;
@@ -25,7 +26,7 @@ export const CARTESIAN_CHART_TYPES = [
/** Cartesian family of chart types @expandType */
export type CartesianChartType = (typeof CARTESIAN_CHART_TYPES)[number];
-export const CATEGORICAL_CHART_TYPES = ['pie', 'funnel'] as const;
+export const CATEGORICAL_CHART_TYPES = ['pie', 'funnel', 'treemap'] as const;
/** Categorical family of chart types @expandType */
export type CategoricalChartType = (typeof CATEGORICAL_CHART_TYPES)[number];
@@ -58,7 +59,8 @@ export type ChartDesignOptions =
| FunnelChartDesignOptions
| PolarChartDesignOptions
| IndicatorChartDesignOptions
- | ScatterChartDesignOptions;
+ | ScatterChartDesignOptions
+ | TreemapChartDesignOptions;
export type ChartConfig = {
chartType: ChartType;
diff --git a/packages/sdk-ui/src/chart-options-processor/translations/value-label-section.ts b/packages/sdk-ui/src/chart-options-processor/translations/value-label-section.ts
index d2da1edc..983a0c02 100644
--- a/packages/sdk-ui/src/chart-options-processor/translations/value-label-section.ts
+++ b/packages/sdk-ui/src/chart-options-processor/translations/value-label-section.ts
@@ -4,7 +4,7 @@
import { Style } from '../chart-options-service';
import { defaultConfig, applyFormatPlainText, NumberFormatConfig } from './number-format-config';
import { AxisOrientation } from './axis-section';
-import { InternalSeries } from '../tooltip';
+import { InternalSeries } from './tooltip-utils';
import { PolarType } from './design-options';
export type ValueLabel = 'horizontal' | 'diagonal' | 'vertical' | null;
diff --git a/packages/sdk-ui/src/charts/indicator/indicator-legacy-chart-options/__mocks__/theme-settings.ts b/packages/sdk-ui/src/charts/indicator/indicator-legacy-chart-options/__mocks__/theme-settings.ts
index 64290260..8c7175da 100644
--- a/packages/sdk-ui/src/charts/indicator/indicator-legacy-chart-options/__mocks__/theme-settings.ts
+++ b/packages/sdk-ui/src/charts/indicator/indicator-legacy-chart-options/__mocks__/theme-settings.ts
@@ -4,6 +4,7 @@ export const darkThemeSettings: ThemeSettings = {
chart: {
backgroundColor: '#333333',
textColor: '#FFFFFF',
+ panelBackgroundColor: '#F6F6F6',
},
typography: {
fontFamily: 'impact',
diff --git a/packages/sdk-ui/src/charts/table/helpers/format-numbers.test.ts b/packages/sdk-ui/src/charts/table/helpers/format-numbers.test.ts
index a232c26d..c59d5273 100644
--- a/packages/sdk-ui/src/charts/table/helpers/format-numbers.test.ts
+++ b/packages/sdk-ui/src/charts/table/helpers/format-numbers.test.ts
@@ -8,9 +8,12 @@ describe('formatNumbers', () => {
const table: DataTable = {
columns: [
{ name: 'item', type: 'string', index: 0, direction: 0 },
- { name: 'price', type: 'int', index: 1, direction: 0 },
+ { name: 'price', type: 'number', index: 1, direction: 0 },
+ { name: 'revenue', type: 'number', index: 1, direction: 0 },
+ ],
+ rows: [
+ [{ displayValue: 'abc' }, { displayValue: '54321.54321' }, { displayValue: '12345.12345' }],
],
- rows: [[{ displayValue: 'abc' }, { displayValue: '1000' }]],
};
const chartDataOptions: TableDataOptions = {
@@ -22,9 +25,14 @@ describe('formatNumbers', () => {
},
{
name: 'price',
- type: 'int',
+ type: 'number',
+ enabled: true,
+ },
+ {
+ name: 'revenue',
+ type: 'number',
enabled: true,
- numberFormatConfig: defaultConfig,
+ numberFormatConfig: { ...defaultConfig, name: 'Currency' },
},
],
};
@@ -41,7 +49,13 @@ describe('formatNumbers', () => {
direction: 0,
index: 1,
name: 'price',
- type: 'int',
+ type: 'number',
+ },
+ {
+ direction: 0,
+ index: 1,
+ name: 'revenue',
+ type: 'number',
},
],
rows: [
@@ -51,11 +65,19 @@ describe('formatNumbers', () => {
},
{
compareValue: {
- value: 1000,
+ value: 54321.54321,
+ valueIsNaN: false,
+ valueUndefined: false,
+ },
+ displayValue: '54.32K',
+ },
+ {
+ compareValue: {
+ value: 12345.12345,
valueIsNaN: false,
valueUndefined: false,
},
- displayValue: '1K',
+ displayValue: '$12.35K',
},
],
],
diff --git a/packages/sdk-ui/src/charts/table/helpers/format-numbers.ts b/packages/sdk-ui/src/charts/table/helpers/format-numbers.ts
index f276dc48..c8ca1883 100644
--- a/packages/sdk-ui/src/charts/table/helpers/format-numbers.ts
+++ b/packages/sdk-ui/src/charts/table/helpers/format-numbers.ts
@@ -2,14 +2,17 @@ import { DataTable } from '../../../chart-data-processor/table-processor';
import { TableDataOptionsInternal } from '../../../chart-data-options/types';
import { isNumber } from '@sisense/sdk-data';
import { createCompareValue } from '../../../chart-data-processor/row-comparator';
-import { applyFormatPlainText } from '../../../chart-options-processor/translations/number-format-config';
+import {
+ applyFormatPlainText,
+ defaultConfig,
+} from '../../../chart-options-processor/translations/number-format-config';
export const formatNumbers = (
table: DataTable,
chartDataOptions: TableDataOptionsInternal,
): DataTable => {
// If there are no numberFormatConfigs, there is no formatting to be done
- if (!chartDataOptions.columns.some((c) => c.numberFormatConfig)) return table;
+ if (!table.columns.some((c) => isNumber(c.type))) return table;
// This reads the number format config from chartDataOptions,
// and apply the format to display value
@@ -20,7 +23,7 @@ export const formatNumbers = (
return row.map((r, index) => {
const columnType = columns[index].type;
- const numberConfig = chartDataOptions.columns[index].numberFormatConfig;
+ const numberConfig = chartDataOptions.columns[index].numberFormatConfig || defaultConfig;
if (isNumber(columnType) && numberConfig) {
const compareValue = createCompareValue(r.displayValue, columnType);
return {
diff --git a/packages/sdk-ui/src/components/__snapshots__/treemap-chart.test.tsx.snap b/packages/sdk-ui/src/components/__snapshots__/treemap-chart.test.tsx.snap
new file mode 100644
index 00000000..cd8e79f8
--- /dev/null
+++ b/packages/sdk-ui/src/components/__snapshots__/treemap-chart.test.tsx.snap
@@ -0,0 +1,1492 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`Treemap Chart > render a treemap with coloring 1`] = `
+{
+ "accessibility": {
+ "enabled": false,
+ },
+ "boost": {
+ "useGPUTranslations": true,
+ "usePreAllocated": true,
+ },
+ "chart": {
+ "alignTicks": false,
+ "animation": {
+ "duration": 300,
+ },
+ "backgroundColor": "#FFFFFF",
+ "events": {},
+ "polar": false,
+ "spacing": [
+ 20,
+ 20,
+ 20,
+ 20,
+ ],
+ "type": "treemap",
+ },
+ "drilldown": {
+ "activeDataLabelStyle": {
+ "color": "#000000",
+ },
+ "breadcrumbs": {
+ "buttonTheme": {
+ "fill": "#ffcb05",
+ "states": {
+ "hover": {
+ "fill": "#f2b900",
+ "stroke": "#f2b900",
+ },
+ },
+ "stroke": "#ffcb05",
+ "style": {
+ "color": "#3a4356",
+ },
+ },
+ },
+ },
+ "legend": {
+ "itemStyle": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "plotOptions": {
+ "pie": {
+ "allowPointSelect": false,
+ "dataLabels": {
+ "pieMinimumFontSizeToTextLabel": 8,
+ "showDecimals": false,
+ "showPercentLabels": true,
+ "style": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "innerSize": "0%",
+ "showInLegend": true,
+ },
+ "series": {
+ "animation": {
+ "duration": 600,
+ },
+ "dataLabels": {
+ "style": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "point": {
+ "events": {},
+ },
+ },
+ },
+ "series": [
+ {
+ "clip": false,
+ "color": "rgb(0, 206, 230)",
+ "data": [
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2009",
+ "name": "2009-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2010",
+ "name": "2010-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2011",
+ "name": "2011-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2012",
+ "name": "2012-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2013",
+ "name": "2013-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2014",
+ "name": "2014-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2015",
+ "name": "2015-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2016",
+ "name": "2016-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2018",
+ "name": "2018-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "color": "#00cee6",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2009_A",
+ "name": "A",
+ "parent": "2009-01-01T00:00:00.000Z",
+ },
+ {
+ "color": "#00cee6",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2010_A",
+ "name": "A",
+ "parent": "2010-01-01T00:00:00.000Z",
+ },
+ {
+ "color": "#9b9bd7",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2011_B",
+ "name": "B",
+ "parent": "2011-01-01T00:00:00.000Z",
+ },
+ {
+ "color": "#9b9bd7",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2012_B",
+ "name": "B",
+ "parent": "2012-01-01T00:00:00.000Z",
+ },
+ {
+ "color": "#00cee6",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2013_A",
+ "name": "A",
+ "parent": "2013-01-01T00:00:00.000Z",
+ },
+ {
+ "color": "#9b9bd7",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2014_B",
+ "name": "B",
+ "parent": "2014-01-01T00:00:00.000Z",
+ },
+ {
+ "color": "#00cee6",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2015_A",
+ "name": "A",
+ "parent": "2015-01-01T00:00:00.000Z",
+ },
+ {
+ "color": "#9b9bd7",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2016_B",
+ "name": "B",
+ "parent": "2016-01-01T00:00:00.000Z",
+ },
+ {
+ "color": "#9b9bd7",
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2018_B",
+ "name": "B",
+ "parent": "2018-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Female",
+ "parent": "2009-01-01T00:00:00.000Z_A",
+ "value": 1322,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2009-01-01T00:00:00.000Z_A",
+ "value": 6781,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Female",
+ "parent": "2010-01-01T00:00:00.000Z_A",
+ "value": 2343,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2010-01-01T00:00:00.000Z_A",
+ "value": 4471,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Female",
+ "parent": "2011-01-01T00:00:00.000Z_B",
+ "value": 1244,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2011-01-01T00:00:00.000Z_B",
+ "value": 1812,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Female",
+ "parent": "2012-01-01T00:00:00.000Z_B",
+ "value": 3422,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2012-01-01T00:00:00.000Z_B",
+ "value": 5001,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2013-01-01T00:00:00.000Z_A",
+ "value": 2045,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2014-01-01T00:00:00.000Z_B",
+ "value": 3010,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2015-01-01T00:00:00.000Z_A",
+ "value": 5447,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2016-01-01T00:00:00.000Z_B",
+ "value": 4242,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2018-01-01T00:00:00.000Z_B",
+ "value": 936,
+ },
+ ],
+ "dataLabels": {
+ "style": {
+ "textOutline": "none",
+ },
+ },
+ "layoutAlgorithm": "strip",
+ "layoutStartingDirection": "horizontal",
+ "levels": [
+ {
+ "borderColor": "white",
+ "borderWidth": 4,
+ "dataLabels": {
+ "align": "left",
+ "allowOverlap": true,
+ "enabled": true,
+ "formatter": [Function],
+ "padding": 0,
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "14px",
+ },
+ "useHTML": true,
+ "verticalAlign": "top",
+ },
+ "layoutAlgorithm": "squarifiedWithTopSpacing",
+ "level": 1,
+ },
+ {
+ "borderColor": "white",
+ "borderWidth": 2,
+ "colorVariation": {
+ "key": "brightness",
+ "to": 0.15,
+ },
+ "dataLabels": {
+ "align": "left",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "14px",
+ },
+ "verticalAlign": "top",
+ },
+ "level": 2,
+ },
+ {
+ "borderColor": "black",
+ "borderWidth": 1,
+ "colorVariation": {
+ "key": "brightness",
+ "to": 0.15,
+ },
+ "dataLabels": {
+ "align": "center",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "13px",
+ },
+ "verticalAlign": "middle",
+ },
+ "level": 3,
+ },
+ ],
+ "name": "Quantity",
+ "type": "treemap",
+ },
+ ],
+ "title": {
+ "text": null,
+ },
+ "tooltip": {
+ "animation": false,
+ "backgroundColor": "#FFFFFF",
+ "borderColor": "#CCCCCC",
+ "borderRadius": 10,
+ "borderWidth": 1,
+ "formatter": [Function],
+ "outside": true,
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ "useHTML": true,
+ },
+ "xAxis": undefined,
+}
+`;
+
+exports[`Treemap Chart > render a treemap with single category 1`] = `
+{
+ "accessibility": {
+ "enabled": false,
+ },
+ "boost": {
+ "useGPUTranslations": true,
+ "usePreAllocated": true,
+ },
+ "chart": {
+ "alignTicks": false,
+ "animation": {
+ "duration": 300,
+ },
+ "backgroundColor": "#FFFFFF",
+ "events": {},
+ "polar": false,
+ "spacing": [
+ 20,
+ 20,
+ 20,
+ 20,
+ ],
+ "type": "treemap",
+ },
+ "drilldown": {
+ "activeDataLabelStyle": {
+ "color": "#000000",
+ },
+ "breadcrumbs": {
+ "buttonTheme": {
+ "fill": "#ffcb05",
+ "states": {
+ "hover": {
+ "fill": "#f2b900",
+ "stroke": "#f2b900",
+ },
+ },
+ "stroke": "#ffcb05",
+ "style": {
+ "color": "#3a4356",
+ },
+ },
+ },
+ },
+ "legend": {
+ "itemStyle": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "plotOptions": {
+ "pie": {
+ "allowPointSelect": false,
+ "dataLabels": {
+ "pieMinimumFontSizeToTextLabel": 8,
+ "showDecimals": false,
+ "showPercentLabels": true,
+ "style": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "innerSize": "0%",
+ "showInLegend": true,
+ },
+ "series": {
+ "animation": {
+ "duration": 600,
+ },
+ "dataLabels": {
+ "style": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "point": {
+ "events": {},
+ },
+ },
+ },
+ "series": [
+ {
+ "clip": false,
+ "color": "rgb(0, 206, 230)",
+ "data": [
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2009",
+ "parent": "",
+ "value": 8103,
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2010",
+ "parent": "",
+ "value": 6814,
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2011",
+ "parent": "",
+ "value": 3056,
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2012",
+ "parent": "",
+ "value": 8423,
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2013",
+ "parent": "",
+ "value": 2045,
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2014",
+ "parent": "",
+ "value": 3010,
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2015",
+ "parent": "",
+ "value": 5447,
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2016",
+ "parent": "",
+ "value": 4242,
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 1,
+ },
+ "name": "2018",
+ "parent": "",
+ "value": 936,
+ },
+ ],
+ "dataLabels": {
+ "style": {
+ "textOutline": "none",
+ },
+ },
+ "layoutAlgorithm": "strip",
+ "layoutStartingDirection": "horizontal",
+ "levels": [
+ {
+ "borderColor": "black",
+ "borderWidth": 1,
+ "dataLabels": {
+ "align": "left",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "14px",
+ },
+ "verticalAlign": "top",
+ },
+ "layoutAlgorithm": "strip",
+ "level": 1,
+ },
+ {
+ "borderColor": "white",
+ "borderWidth": 2,
+ "dataLabels": {
+ "align": "left",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "14px",
+ },
+ "verticalAlign": "top",
+ },
+ "level": 2,
+ },
+ {
+ "borderColor": "black",
+ "borderWidth": 1,
+ "dataLabels": {
+ "align": "center",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "13px",
+ },
+ "verticalAlign": "middle",
+ },
+ "level": 3,
+ },
+ ],
+ "name": "Quantity",
+ "type": "treemap",
+ },
+ ],
+ "title": {
+ "text": null,
+ },
+ "tooltip": {
+ "animation": false,
+ "backgroundColor": "#FFFFFF",
+ "borderColor": "#CCCCCC",
+ "borderRadius": 10,
+ "borderWidth": 1,
+ "formatter": [Function],
+ "outside": true,
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ "useHTML": true,
+ },
+ "xAxis": undefined,
+}
+`;
+
+exports[`Treemap Chart > render a treemap with three categories 1`] = `
+{
+ "accessibility": {
+ "enabled": false,
+ },
+ "boost": {
+ "useGPUTranslations": true,
+ "usePreAllocated": true,
+ },
+ "chart": {
+ "alignTicks": false,
+ "animation": {
+ "duration": 300,
+ },
+ "backgroundColor": "#FFFFFF",
+ "events": {},
+ "polar": false,
+ "spacing": [
+ 20,
+ 20,
+ 20,
+ 20,
+ ],
+ "type": "treemap",
+ },
+ "drilldown": {
+ "activeDataLabelStyle": {
+ "color": "#000000",
+ },
+ "breadcrumbs": {
+ "buttonTheme": {
+ "fill": "#ffcb05",
+ "states": {
+ "hover": {
+ "fill": "#f2b900",
+ "stroke": "#f2b900",
+ },
+ },
+ "stroke": "#ffcb05",
+ "style": {
+ "color": "#3a4356",
+ },
+ },
+ },
+ },
+ "legend": {
+ "itemStyle": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "plotOptions": {
+ "pie": {
+ "allowPointSelect": false,
+ "dataLabels": {
+ "pieMinimumFontSizeToTextLabel": 8,
+ "showDecimals": false,
+ "showPercentLabels": true,
+ "style": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "innerSize": "0%",
+ "showInLegend": true,
+ },
+ "series": {
+ "animation": {
+ "duration": 600,
+ },
+ "dataLabels": {
+ "style": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "point": {
+ "events": {},
+ },
+ },
+ },
+ "series": [
+ {
+ "clip": false,
+ "color": "rgb(0, 206, 230)",
+ "data": [
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2009",
+ "name": "2009-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2010",
+ "name": "2010-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2011",
+ "name": "2011-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2012",
+ "name": "2012-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2013",
+ "name": "2013-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2014",
+ "name": "2014-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2015",
+ "name": "2015-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2016",
+ "name": "2016-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 3,
+ },
+ "id": "2018",
+ "name": "2018-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2009_A",
+ "name": "A",
+ "parent": "2009-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2010_A",
+ "name": "A",
+ "parent": "2010-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2011_B",
+ "name": "B",
+ "parent": "2011-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2012_B",
+ "name": "B",
+ "parent": "2012-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2013_A",
+ "name": "A",
+ "parent": "2013-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2014_B",
+ "name": "B",
+ "parent": "2014-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2015_A",
+ "name": "A",
+ "parent": "2015-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2016_B",
+ "name": "B",
+ "parent": "2016-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 3,
+ },
+ "id": "2018_B",
+ "name": "B",
+ "parent": "2018-01-01T00:00:00.000Z",
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Female",
+ "parent": "2009-01-01T00:00:00.000Z_A",
+ "value": 1322,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2009-01-01T00:00:00.000Z_A",
+ "value": 6781,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Female",
+ "parent": "2010-01-01T00:00:00.000Z_A",
+ "value": 2343,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2010-01-01T00:00:00.000Z_A",
+ "value": 4471,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Female",
+ "parent": "2011-01-01T00:00:00.000Z_B",
+ "value": 1244,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2011-01-01T00:00:00.000Z_B",
+ "value": 1812,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Female",
+ "parent": "2012-01-01T00:00:00.000Z_B",
+ "value": 3422,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2012-01-01T00:00:00.000Z_B",
+ "value": 5001,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2013-01-01T00:00:00.000Z_A",
+ "value": 2045,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2014-01-01T00:00:00.000Z_B",
+ "value": 3010,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2015-01-01T00:00:00.000Z_A",
+ "value": 5447,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2016-01-01T00:00:00.000Z_B",
+ "value": 4242,
+ },
+ {
+ "custom": {
+ "level": 3,
+ "levelsCount": 3,
+ },
+ "name": "Male",
+ "parent": "2018-01-01T00:00:00.000Z_B",
+ "value": 936,
+ },
+ ],
+ "dataLabels": {
+ "style": {
+ "textOutline": "none",
+ },
+ },
+ "layoutAlgorithm": "strip",
+ "layoutStartingDirection": "horizontal",
+ "levels": [
+ {
+ "borderColor": "white",
+ "borderWidth": 4,
+ "dataLabels": {
+ "align": "left",
+ "allowOverlap": true,
+ "enabled": true,
+ "formatter": [Function],
+ "padding": 0,
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "14px",
+ },
+ "useHTML": true,
+ "verticalAlign": "top",
+ },
+ "layoutAlgorithm": "squarifiedWithTopSpacing",
+ "level": 1,
+ },
+ {
+ "borderColor": "white",
+ "borderWidth": 2,
+ "dataLabels": {
+ "align": "left",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "14px",
+ },
+ "verticalAlign": "top",
+ },
+ "level": 2,
+ },
+ {
+ "borderColor": "black",
+ "borderWidth": 1,
+ "dataLabels": {
+ "align": "center",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "13px",
+ },
+ "verticalAlign": "middle",
+ },
+ "level": 3,
+ },
+ ],
+ "name": "Quantity",
+ "type": "treemap",
+ },
+ ],
+ "title": {
+ "text": null,
+ },
+ "tooltip": {
+ "animation": false,
+ "backgroundColor": "#FFFFFF",
+ "borderColor": "#CCCCCC",
+ "borderRadius": 10,
+ "borderWidth": 1,
+ "formatter": [Function],
+ "outside": true,
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ "useHTML": true,
+ },
+ "xAxis": undefined,
+}
+`;
+
+exports[`Treemap Chart > render a treemap with two categories 1`] = `
+{
+ "accessibility": {
+ "enabled": false,
+ },
+ "boost": {
+ "useGPUTranslations": true,
+ "usePreAllocated": true,
+ },
+ "chart": {
+ "alignTicks": false,
+ "animation": {
+ "duration": 300,
+ },
+ "backgroundColor": "#FFFFFF",
+ "events": {},
+ "polar": false,
+ "spacing": [
+ 20,
+ 20,
+ 20,
+ 20,
+ ],
+ "type": "treemap",
+ },
+ "drilldown": {
+ "activeDataLabelStyle": {
+ "color": "#000000",
+ },
+ "breadcrumbs": {
+ "buttonTheme": {
+ "fill": "#ffcb05",
+ "states": {
+ "hover": {
+ "fill": "#f2b900",
+ "stroke": "#f2b900",
+ },
+ },
+ "stroke": "#ffcb05",
+ "style": {
+ "color": "#3a4356",
+ },
+ },
+ },
+ },
+ "legend": {
+ "itemStyle": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "plotOptions": {
+ "pie": {
+ "allowPointSelect": false,
+ "dataLabels": {
+ "pieMinimumFontSizeToTextLabel": 8,
+ "showDecimals": false,
+ "showPercentLabels": true,
+ "style": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "innerSize": "0%",
+ "showInLegend": true,
+ },
+ "series": {
+ "animation": {
+ "duration": 600,
+ },
+ "dataLabels": {
+ "style": {
+ "color": "#000000",
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ },
+ "point": {
+ "events": {},
+ },
+ },
+ },
+ "series": [
+ {
+ "clip": false,
+ "color": "rgb(0, 206, 230)",
+ "data": [
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2009",
+ "name": "2009-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2010",
+ "name": "2010-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2011",
+ "name": "2011-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2012",
+ "name": "2012-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2013",
+ "name": "2013-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2014",
+ "name": "2014-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2015",
+ "name": "2015-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2016",
+ "name": "2016-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 1,
+ "levelsCount": 2,
+ },
+ "id": "2018",
+ "name": "2018-01-01T00:00:00.000Z",
+ "parent": "",
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "A",
+ "parent": "2009-01-01T00:00:00.000Z",
+ "value": 8103,
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "A",
+ "parent": "2010-01-01T00:00:00.000Z",
+ "value": 6814,
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "B",
+ "parent": "2011-01-01T00:00:00.000Z",
+ "value": 3056,
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "B",
+ "parent": "2012-01-01T00:00:00.000Z",
+ "value": 8423,
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "A",
+ "parent": "2013-01-01T00:00:00.000Z",
+ "value": 2045,
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "B",
+ "parent": "2014-01-01T00:00:00.000Z",
+ "value": 3010,
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "A",
+ "parent": "2015-01-01T00:00:00.000Z",
+ "value": 5447,
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "B",
+ "parent": "2016-01-01T00:00:00.000Z",
+ "value": 4242,
+ },
+ {
+ "custom": {
+ "level": 2,
+ "levelsCount": 2,
+ },
+ "name": "B",
+ "parent": "2018-01-01T00:00:00.000Z",
+ "value": 936,
+ },
+ ],
+ "dataLabels": {
+ "style": {
+ "textOutline": "none",
+ },
+ },
+ "layoutAlgorithm": "strip",
+ "layoutStartingDirection": "horizontal",
+ "levels": [
+ {
+ "borderColor": "white",
+ "borderWidth": 4,
+ "dataLabels": {
+ "align": "left",
+ "allowOverlap": true,
+ "enabled": true,
+ "formatter": [Function],
+ "padding": 0,
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "14px",
+ },
+ "useHTML": true,
+ "verticalAlign": "top",
+ },
+ "layoutAlgorithm": "squarifiedWithTopSpacing",
+ "level": 1,
+ },
+ {
+ "borderColor": "black",
+ "borderWidth": 1,
+ "dataLabels": {
+ "align": "left",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "14px",
+ },
+ "verticalAlign": "top",
+ },
+ "level": 2,
+ },
+ {
+ "borderColor": "black",
+ "borderWidth": 1,
+ "dataLabels": {
+ "align": "center",
+ "enabled": true,
+ "formatter": [Function],
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ "fontSize": "13px",
+ },
+ "verticalAlign": "middle",
+ },
+ "level": 3,
+ },
+ ],
+ "name": "Quantity",
+ "type": "treemap",
+ },
+ ],
+ "title": {
+ "text": null,
+ },
+ "tooltip": {
+ "animation": false,
+ "backgroundColor": "#FFFFFF",
+ "borderColor": "#CCCCCC",
+ "borderRadius": 10,
+ "borderWidth": 1,
+ "formatter": [Function],
+ "outside": true,
+ "style": {
+ "fontFamily": "\\"Open Sans\\",\\"Roboto\\",\\"Helvetica\\",\\"Arial\\",sans-serif",
+ },
+ "useHTML": true,
+ },
+ "xAxis": undefined,
+}
+`;
diff --git a/packages/sdk-ui/src/components/chart.test.tsx b/packages/sdk-ui/src/components/chart.test.tsx
index 4b1bf719..72efe6ce 100644
--- a/packages/sdk-ui/src/components/chart.test.tsx
+++ b/packages/sdk-ui/src/components/chart.test.tsx
@@ -95,6 +95,7 @@ it('change theme of a chart', () => {
textColor: 'red',
secondaryTextColor: 'green',
backgroundColor: 'blue',
+ panelBackgroundColor: '#F6F6F6',
},
}}
>
diff --git a/packages/sdk-ui/src/components/highcharts-wrapper.tsx b/packages/sdk-ui/src/components/highcharts-wrapper.tsx
index ff565f9c..e9d1e233 100644
--- a/packages/sdk-ui/src/components/highcharts-wrapper.tsx
+++ b/packages/sdk-ui/src/components/highcharts-wrapper.tsx
@@ -67,6 +67,7 @@ export const HighchartsWrapper: FunctionComponent