@eclipse-scout/chart 23.1.19 → 23.2.2

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 (33) hide show
  1. package/dist/d.ts/chart/AbstractChartRenderer.d.ts.map +1 -1
  2. package/dist/d.ts/chart/Chart.d.ts +1 -1
  3. package/dist/d.ts/chart/Chart.d.ts.map +1 -1
  4. package/dist/d.ts/chart/ChartJsRenderer.d.ts +8 -8
  5. package/dist/d.ts/chart/ChartJsRenderer.d.ts.map +1 -1
  6. package/dist/d.ts/chart/VennChartRenderer.d.ts.map +1 -1
  7. package/dist/d.ts/table/controls/ChartTableControl.d.ts +1 -0
  8. package/dist/d.ts/table/controls/ChartTableControl.d.ts.map +1 -1
  9. package/dist/eclipse-scout-chart-7bef43c691398f0f5930.min.js +3 -0
  10. package/dist/eclipse-scout-chart-7bef43c691398f0f5930.min.js.map +1 -0
  11. package/dist/eclipse-scout-chart-theme-dark.css +1 -1
  12. package/dist/eclipse-scout-chart-theme-dark.css.map +1 -1
  13. package/dist/eclipse-scout-chart-theme.css +1 -1
  14. package/dist/eclipse-scout-chart-theme.css.map +1 -1
  15. package/dist/eclipse-scout-chart.esm-cf2a1f4f475648b72788.min.js +3 -0
  16. package/dist/eclipse-scout-chart.esm-cf2a1f4f475648b72788.min.js.map +1 -0
  17. package/dist/eclipse-scout-chart.esm.js +88 -40
  18. package/dist/eclipse-scout-chart.esm.js.map +1 -1
  19. package/dist/eclipse-scout-chart.js +90 -40
  20. package/dist/eclipse-scout-chart.js.map +1 -1
  21. package/dist/file-list +4 -4
  22. package/package.json +6 -6
  23. package/src/chart/AbstractChartRenderer.ts +2 -2
  24. package/src/chart/Chart.ts +1 -1
  25. package/src/chart/ChartJsRenderer.ts +81 -39
  26. package/src/chart/FulfillmentChartRenderer.ts +3 -3
  27. package/src/chart/SalesfunnelChartRenderer.ts +3 -3
  28. package/src/chart/VennChartRenderer.ts +4 -3
  29. package/src/table/controls/ChartTableControl.ts +9 -4
  30. package/dist/eclipse-scout-chart-c0371fbf62b6717784f4.min.js +0 -3
  31. package/dist/eclipse-scout-chart-c0371fbf62b6717784f4.min.js.map +0 -1
  32. package/dist/eclipse-scout-chart.esm-a918cb3af9403c83adfe.min.js +0 -3
  33. package/dist/eclipse-scout-chart.esm-a918cb3af9403c83adfe.min.js.map +0 -1
package/dist/file-list CHANGED
@@ -1,13 +1,13 @@
1
- eclipse-scout-chart-c0371fbf62b6717784f4.min.js
2
- eclipse-scout-chart-c0371fbf62b6717784f4.min.js.map
1
+ eclipse-scout-chart-7bef43c691398f0f5930.min.js
2
+ eclipse-scout-chart-7bef43c691398f0f5930.min.js.map
3
3
  eclipse-scout-chart-theme-56ba6667e592ef147869.min.css
4
4
  eclipse-scout-chart-theme-dark-593955eea95984c5aa62.min.css
5
5
  eclipse-scout-chart-theme-dark.css
6
6
  eclipse-scout-chart-theme-dark.css.map
7
7
  eclipse-scout-chart-theme.css
8
8
  eclipse-scout-chart-theme.css.map
9
- eclipse-scout-chart.esm-a918cb3af9403c83adfe.min.js
10
- eclipse-scout-chart.esm-a918cb3af9403c83adfe.min.js.map
9
+ eclipse-scout-chart.esm-cf2a1f4f475648b72788.min.js
10
+ eclipse-scout-chart.esm-cf2a1f4f475648b72788.min.js.map
11
11
  eclipse-scout-chart.esm.js
12
12
  eclipse-scout-chart.esm.js.map
13
13
  eclipse-scout-chart.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-scout/chart",
3
- "version": "23.1.19",
3
+ "version": "23.2.2",
4
4
  "description": "Eclipse Scout chart",
5
5
  "author": "BSI Business Systems Integration AG",
6
6
  "homepage": "https://www.eclipse.org/scout",
@@ -26,17 +26,17 @@
26
26
  "src"
27
27
  ],
28
28
  "devDependencies": {
29
- "@eclipse-scout/cli": "23.1.19",
29
+ "@eclipse-scout/cli": "23.2.2",
30
30
  "@eclipse-scout/releng": "^22.0.0",
31
- "jasmine-core": "4.5.0",
31
+ "jasmine-core": "4.6.0",
32
32
  "jasmine-jquery": "2.1.1",
33
33
  "karma": "6.4.1",
34
- "@types/jquery": "3.5.14",
35
- "@types/jasmine": "4.3.0",
34
+ "@types/jquery": "3.5.16",
35
+ "@types/jasmine": "4.3.1",
36
36
  "@types/jasmine-jquery": "1.5.34"
37
37
  },
38
38
  "dependencies": {
39
- "@eclipse-scout/core": "23.1.19",
39
+ "@eclipse-scout/core": "23.2.2",
40
40
  "jquery": "3.6.0",
41
41
  "chart.js": "3.9.1",
42
42
  "chartjs-plugin-datalabels": "2.1.0"
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import {Chart} from '../index';
12
- import {Session} from '@eclipse-scout/core';
12
+ import {arrays, Session} from '@eclipse-scout/core';
13
13
  import {UpdateChartOptions} from './Chart';
14
14
 
15
15
  export class AbstractChartRenderer {
@@ -63,7 +63,7 @@ export class AbstractChartRenderer {
63
63
  }
64
64
  }
65
65
  // color should have been set.
66
- if (!this.chart.config.options.autoColor && !chartValueGroup.colorHexValue && !chartValueGroup.cssClass) {
66
+ if (!this.chart.config.options.autoColor && !arrays.ensure(chartValueGroup.colorHexValue).length && !chartValueGroup.cssClass) {
67
67
  return false;
68
68
  }
69
69
  }
@@ -402,7 +402,7 @@ export type ChartValueGroup = {
402
402
  type?: string;
403
403
  groupName?: string;
404
404
  values: number[] | Record<string, number>[];
405
- colorHexValue?: string;
405
+ colorHexValue?: string | string[];
406
406
  cssClass?: string;
407
407
  };
408
408
 
@@ -10,8 +10,8 @@
10
10
  import {AbstractChartRenderer, Chart, chartJsDateAdapter} from '../index';
11
11
  import {
12
12
  _adapters as chartJsAdapters, ActiveElement, ArcElement, BarElement, BubbleDataPoint, CartesianScaleOptions, Chart as ChartJs, ChartArea, ChartConfiguration, ChartDataset, ChartEvent, ChartType as ChartJsType, Color, DefaultDataPoint,
13
- FontSpec, LegendElement,
14
- LegendItem, LegendOptions, LinearScaleOptions, PointElement, PointHoverOptions, PointOptions, PointProps, RadialLinearScaleOptions, Scale, ScatterDataPoint, TooltipCallbacks, TooltipItem, TooltipLabelStyle, TooltipModel, TooltipOptions
13
+ FontSpec, LegendElement, LegendItem, LegendOptions, LinearScaleOptions, PointElement, PointHoverOptions, PointOptions, PointProps, RadialLinearScaleOptions, Scale, ScatterDataPoint, TooltipCallbacks, TooltipItem, TooltipLabelStyle,
14
+ TooltipModel, TooltipOptions
15
15
  } from 'chart.js';
16
16
  import 'chart.js/auto'; // Import from auto to register charts
17
17
  import {arrays, colorSchemes, graphics, numbers, objects, Point, scout, strings, styles, Tooltip, tooltips} from '@eclipse-scout/core';
@@ -899,7 +899,7 @@ export class ChartJsRenderer extends AbstractChartRenderer {
899
899
  legendColor, backgroundColor, borderColor, index;
900
900
  if (scout.isOneOf((dataset.type || config.type), Chart.Type.LINE, Chart.Type.BAR, Chart.Type.BAR_HORIZONTAL, Chart.Type.RADAR, Chart.Type.BUBBLE, Chart.Type.SCATTER)) {
901
901
  borderColor = dataset.borderColor;
902
- legendColor = dataset.legendColor;
902
+ legendColor = Array.isArray(dataset.legendColor) ? dataset.legendColor[tooltipItem.dataIndex] : dataset.legendColor;
903
903
  index = tooltipItem.datasetIndex;
904
904
  }
905
905
  if (scout.isOneOf(config.type, Chart.Type.PIE, Chart.Type.DOUGHNUT, Chart.Type.POLAR_AREA)) {
@@ -1643,12 +1643,21 @@ export class ChartJsRenderer extends AbstractChartRenderer {
1643
1643
  colors = $.extend(true, colors, this._computeDatasetColors(config, multipleColorsPerDataset));
1644
1644
 
1645
1645
  data.datasets.forEach((elem, idx) => {
1646
- let backgroundColor = (multipleColorsPerDataset ? colors.backgroundColors : colors.backgroundColors[idx]),
1647
- borderColor = (multipleColorsPerDataset ? colors.borderColors : colors.borderColors[idx]),
1648
- hoverBackgroundColor = (multipleColorsPerDataset ? colors.hoverBackgroundColors : colors.hoverBackgroundColors[idx]),
1649
- hoverBorderColor = (multipleColorsPerDataset ? colors.hoverBorderColors : colors.hoverBorderColors[idx]),
1650
- legendColor = (multipleColorsPerDataset ? colors.legendColors : colors.legendColors[idx]),
1651
- pointHoverBackgroundColor = (multipleColorsPerDataset ? colors.pointHoverColors : colors.legendColors[idx]);
1646
+ const getColor = colorsArray => {
1647
+ let candidate = colorsArray[idx];
1648
+ if (multipleColorsPerDataset && !Array.isArray(candidate)) {
1649
+ // we want multiple colors -> get the parent array
1650
+ candidate = colorsArray;
1651
+ }
1652
+ return candidate;
1653
+ };
1654
+
1655
+ let backgroundColor = getColor(colors.backgroundColors),
1656
+ borderColor = getColor(colors.borderColors),
1657
+ hoverBackgroundColor = getColor(colors.hoverBackgroundColors),
1658
+ hoverBorderColor = getColor(colors.hoverBorderColors),
1659
+ legendColor = getColor(colors.legendColors),
1660
+ pointHoverBackgroundColor = getColor(colors.pointHoverColors);
1652
1661
 
1653
1662
  let setProperty = (identifier, value) => {
1654
1663
  if (typeof elem[identifier] === 'function') {
@@ -1669,13 +1678,19 @@ export class ChartJsRenderer extends AbstractChartRenderer {
1669
1678
  setProperty('pointHoverBorderColor', this.firstOpaqueBackgroundColor);
1670
1679
  }
1671
1680
  if (checkable) {
1672
- let datasetLength = elem.data.length;
1681
+ const datasetLength = elem.data.length,
1682
+ ensureColorArray = color => {
1683
+ if (Array.isArray(color)) {
1684
+ return color;
1685
+ }
1686
+ return arrays.init(datasetLength, color);
1687
+ };
1673
1688
  if (scout.isOneOf(type, Chart.Type.PIE, Chart.Type.DOUGHNUT, Chart.Type.POLAR_AREA, Chart.Type.BUBBLE, Chart.Type.SCATTER) || (type === Chart.Type.BAR && (elem.type || Chart.Type.BAR) === Chart.Type.BAR)) {
1674
- let uncheckedBackgroundColor = (multipleColorsPerDataset ? colors.backgroundColors : arrays.init(datasetLength, colors.backgroundColors[idx])),
1675
- uncheckedHoverBackgroundColor = (multipleColorsPerDataset ? colors.hoverBackgroundColors : arrays.init(datasetLength, colors.hoverBackgroundColors[idx])),
1689
+ let uncheckedBackgroundColor = ensureColorArray(backgroundColor),
1690
+ uncheckedHoverBackgroundColor = ensureColorArray(hoverBackgroundColor),
1676
1691
 
1677
- checkedBackgroundColor = (multipleColorsPerDataset ? colors.checkedBackgroundColors : arrays.init(datasetLength, colors.checkedBackgroundColors[idx])),
1678
- checkedHoverBackgroundColor = (multipleColorsPerDataset ? colors.checkedHoverBackgroundColors : arrays.init(datasetLength, colors.checkedHoverBackgroundColors[idx]));
1692
+ checkedBackgroundColor = ensureColorArray(getColor(colors.checkedBackgroundColors)),
1693
+ checkedHoverBackgroundColor = ensureColorArray(getColor(colors.checkedHoverBackgroundColors));
1679
1694
 
1680
1695
  setProperty('uncheckedBackgroundColor', uncheckedBackgroundColor);
1681
1696
  setProperty('uncheckedHoverBackgroundColor', uncheckedHoverBackgroundColor);
@@ -1685,10 +1700,12 @@ export class ChartJsRenderer extends AbstractChartRenderer {
1685
1700
  setProperty('backgroundColor', elem.uncheckedBackgroundColor);
1686
1701
  setProperty('hoverBackgroundColor', elem.uncheckedHoverBackgroundColor);
1687
1702
  } else if (scout.isOneOf(type, Chart.Type.LINE, Chart.Type.RADAR) || (type === Chart.Type.BAR && elem.type === Chart.Type.LINE)) {
1688
- let uncheckedPointBackgroundColor = arrays.init(datasetLength, pointHoverBackgroundColor),
1689
- uncheckedPointHoverBackgroundColor = arrays.init(datasetLength, pointHoverBackgroundColor),
1690
- checkedPointBackgroundColor = arrays.init(datasetLength, borderColor),
1691
- checkedPointHoverBackgroundColor = arrays.init(datasetLength, hoverBorderColor || borderColor);
1703
+ let uncheckedPointBackgroundColor = ensureColorArray(pointHoverBackgroundColor),
1704
+ uncheckedPointHoverBackgroundColor = ensureColorArray(pointHoverBackgroundColor),
1705
+
1706
+ checkedPointBackgroundColor = ensureColorArray(borderColor),
1707
+ checkedPointHoverBackgroundColor = ensureColorArray(hoverBorderColor || borderColor);
1708
+
1692
1709
  setProperty('uncheckedPointBackgroundColor', uncheckedPointBackgroundColor);
1693
1710
  setProperty('uncheckedPointHoverBackgroundColor', uncheckedPointHoverBackgroundColor);
1694
1711
  setProperty('checkedPointBackgroundColor', checkedPointBackgroundColor);
@@ -1838,9 +1855,6 @@ export class ChartJsRenderer extends AbstractChartRenderer {
1838
1855
  };
1839
1856
 
1840
1857
  this.chart.data.chartValueGroups.forEach(elem => {
1841
- let rgbColor = styles.hexToRgb(elem.colorHexValue),
1842
- adjustColor = (opacity, darker) => this._adjustColorOpacity(styles.darkerColor(rgbColor, darker), opacity);
1843
-
1844
1858
  let backgroundOpacity = 1,
1845
1859
  hoverBackgroundOpacity = 1,
1846
1860
  hoverBackgroundDarker = 0.1,
@@ -1884,17 +1898,45 @@ export class ChartJsRenderer extends AbstractChartRenderer {
1884
1898
  hoverBackgroundDarker = 0;
1885
1899
  }
1886
1900
 
1887
- colors.backgroundColors.push(adjustColor((checkable || transparent) ? uncheckedBackgroundOpacity : backgroundOpacity, 0));
1888
- colors.borderColors.push(adjustColor(1, 0));
1889
- colors.hoverBackgroundColors.push(adjustColor((checkable || transparent) ? uncheckedHoverBackgroundOpacity : hoverBackgroundOpacity, (checkable || transparent) ? 0 : hoverBackgroundDarker));
1890
- colors.hoverBorderColors.push(adjustColor(1, hoverBorderDarker));
1891
-
1892
- colors.checkedBackgroundColors.push(adjustColor(checkedBackgroundOpacity, checkedBackgroundDarker));
1893
- colors.checkedHoverBackgroundColors.push(adjustColor(checkedHoverBackgroundOpacity, checkedHoverBackgroundDarker));
1901
+ const backgroundColors = [],
1902
+ borderColors = [],
1903
+ hoverBackgroundColors = [],
1904
+ hoverBorderColors = [],
1905
+ checkedBackgroundColors = [],
1906
+ checkedHoverBackgroundColors = [],
1907
+ legendColors = [],
1908
+ pointHoverColors = [];
1909
+
1910
+ let colorHexValues = arrays.ensure(elem.colorHexValue);
1911
+
1912
+ const datasetLength = arrays.length(elem.values as any[]);
1913
+ if (colorHexValues.length && colorHexValues.length < datasetLength) {
1914
+ // repeat colors for the whole dataset
1915
+ colorHexValues = arrays.init(datasetLength, null).map((elem, idx) => colorHexValues[idx % colorHexValues.length]);
1916
+ }
1894
1917
 
1895
- colors.legendColors.push(adjustColor(1, 0));
1918
+ colorHexValues.forEach(colorHexValue => {
1919
+ const rgbColor = styles.hexToRgb(colorHexValue),
1920
+ adjustColor = (opacity, darker) => this._adjustColorOpacity(styles.darkerColor(rgbColor, darker), opacity);
1921
+
1922
+ backgroundColors.push(adjustColor((checkable || transparent) ? uncheckedBackgroundOpacity : backgroundOpacity, 0));
1923
+ borderColors.push(adjustColor(1, 0));
1924
+ hoverBackgroundColors.push(adjustColor((checkable || transparent) ? uncheckedHoverBackgroundOpacity : hoverBackgroundOpacity, (checkable || transparent) ? 0 : hoverBackgroundDarker));
1925
+ hoverBorderColors.push(adjustColor(1, hoverBorderDarker));
1926
+ checkedBackgroundColors.push(adjustColor(checkedBackgroundOpacity, checkedBackgroundDarker));
1927
+ checkedHoverBackgroundColors.push(adjustColor(checkedHoverBackgroundOpacity, checkedHoverBackgroundDarker));
1928
+ legendColors.push(adjustColor(1, 0));
1929
+ pointHoverColors.push(adjustColor(1, 0));
1930
+ });
1896
1931
 
1897
- colors.pointHoverColors.push(adjustColor(1, 0));
1932
+ colors.backgroundColors.push(backgroundColors);
1933
+ colors.borderColors.push(borderColors);
1934
+ colors.hoverBackgroundColors.push(hoverBackgroundColors);
1935
+ colors.hoverBorderColors.push(hoverBorderColors);
1936
+ colors.checkedBackgroundColors.push(checkedBackgroundColors);
1937
+ colors.checkedHoverBackgroundColors.push(checkedHoverBackgroundColors);
1938
+ colors.legendColors.push(legendColors);
1939
+ colors.pointHoverColors.push(pointHoverColors);
1898
1940
  });
1899
1941
  colors.datalabelColor = this._computeDatalabelColor(type);
1900
1942
 
@@ -1985,7 +2027,7 @@ export class ChartJsRenderer extends AbstractChartRenderer {
1985
2027
  let dataset = data.datasets[idx],
1986
2028
  legendColor, borderColor, backgroundColor;
1987
2029
  if (dataset && scout.isOneOf((dataset.type || config.type), Chart.Type.LINE, Chart.Type.BAR, Chart.Type.RADAR, Chart.Type.BUBBLE, Chart.Type.SCATTER)) {
1988
- legendColor = dataset.legendColor;
2030
+ legendColor = arrays.ensure(dataset.legendColor)[0];
1989
2031
  borderColor = this._adjustColorOpacity(dataset.borderColor as string, 1);
1990
2032
  } else if (data.datasets.length && scout.isOneOf(config.type, Chart.Type.PIE, Chart.Type.DOUGHNUT, Chart.Type.POLAR_AREA)) {
1991
2033
  dataset = data.datasets[0];
@@ -2782,14 +2824,14 @@ export type TooltipLabelColorGenerator = (tooltipItem: TooltipItem<any>) => Tool
2782
2824
  export type TooltipRenderer = (context: { chart: ChartJs; tooltip: TooltipModel<any> }) => void;
2783
2825
 
2784
2826
  export type DatasetColors = {
2785
- backgroundColors?: string[];
2786
- borderColors?: string[];
2787
- hoverBackgroundColors?: string[];
2788
- hoverBorderColors?: string[];
2789
- checkedBackgroundColors?: string[];
2790
- checkedHoverBackgroundColors?: string[];
2791
- legendColors?: string[];
2792
- pointHoverColors?: string[];
2827
+ backgroundColors?: (string | string[])[];
2828
+ borderColors?: (string | string[])[];
2829
+ hoverBackgroundColors?: (string | string[])[];
2830
+ hoverBorderColors?: (string | string[])[];
2831
+ checkedBackgroundColors?: (string | string[])[];
2832
+ checkedHoverBackgroundColors?: (string | string[])[];
2833
+ legendColors?: (string | string[])[];
2834
+ pointHoverColors?: (string | string[])[];
2793
2835
  datalabelColor?: string;
2794
2836
  };
2795
2837
 
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * SPDX-License-Identifier: EPL-2.0
9
9
  */
10
- import {objects, scout} from '@eclipse-scout/core';
10
+ import {arrays, objects, scout} from '@eclipse-scout/core';
11
11
  import {AbstractSvgChartRenderer, Chart} from '../index';
12
12
  import $ from 'jquery';
13
13
  import {UpdateChartOptions} from './Chart';
@@ -60,7 +60,7 @@ export class FulfillmentChartRenderer extends AbstractSvgChartRenderer {
60
60
  protected _renderPercentage(value: number, total: number) {
61
61
  // arc segment
62
62
  let arcClass = 'fulfillment-chart',
63
- color = this.chart.data.chartValueGroups[0].colorHexValue,
63
+ color = arrays.ensure(this.chart.data.chartValueGroups[0].colorHexValue)[0],
64
64
  chartGroupCss = this.chart.data.chartValueGroups[0].cssClass;
65
65
 
66
66
  if (this.chart.config.options.autoColor) {
@@ -142,7 +142,7 @@ export class FulfillmentChartRenderer extends AbstractSvgChartRenderer {
142
142
 
143
143
  protected _renderCirclePath(cssClass: string, id: string, radius: number): JQuery<SVGElement> {
144
144
  let chartGroupCss = this.chart.data.chartValueGroups[0].cssClass;
145
- let color = this.chart.data.chartValueGroups[1].colorHexValue;
145
+ let color = arrays.ensure(this.chart.data.chartValueGroups[1].colorHexValue)[0];
146
146
 
147
147
  if (this.chart.config.options.autoColor) {
148
148
  cssClass += ' auto-color';
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * SPDX-License-Identifier: EPL-2.0
9
9
  */
10
- import {objects, strings} from '@eclipse-scout/core';
10
+ import {arrays, objects, strings} from '@eclipse-scout/core';
11
11
  import {AbstractSvgChartRenderer, Chart} from '../index';
12
12
  import $ from 'jquery';
13
13
  import {ChartValueGroup, ClickObject} from './Chart';
@@ -126,7 +126,7 @@ export class SalesfunnelChartRenderer extends AbstractSvgChartRenderer {
126
126
  width: width,
127
127
  widthBottom: widthBottom,
128
128
  cssClass: 'salesfunnel-chart-bar',
129
- fill: chartValueGroups[i].colorHexValue,
129
+ fill: arrays.ensure(chartValueGroups[i].colorHexValue)[0],
130
130
  label: chartValueGroups[i].groupName,
131
131
  clickObject: this._createClickObject(null, i)
132
132
  };
@@ -318,7 +318,7 @@ export class SalesfunnelChartRenderer extends AbstractSvgChartRenderer {
318
318
  width: width,
319
319
  widthBottom: width,
320
320
  cssClass: 'salesfunnel-chart-bar',
321
- fill: chartValueGroups[i].colorHexValue,
321
+ fill: arrays.ensure(chartValueGroups[i].colorHexValue)[0],
322
322
  label: chartValueGroups[i].groupName,
323
323
  clickObject: this._createClickObject(null, i)
324
324
  };
@@ -11,6 +11,7 @@ import {AbstractSvgChartRenderer, Chart, VennAsync3Calculator, VennCircle, VennC
11
11
  import $ from 'jquery';
12
12
  import {ChartValueGroup} from './Chart';
13
13
  import {LegendPositions} from './AbstractSvgChartRenderer';
14
+ import {arrays} from '@eclipse-scout/core';
14
15
 
15
16
  export class VennChartRenderer extends AbstractSvgChartRenderer {
16
17
  animationTriggered: boolean;
@@ -86,17 +87,17 @@ export class VennChartRenderer extends AbstractSvgChartRenderer {
86
87
 
87
88
  // create svg elements and venns
88
89
  if (this.numberOfCircles > 0) {
89
- this.$v1 = this._createCircle(0, this.data[0].colorHexValue, this.data[0].cssClass);
90
+ this.$v1 = this._createCircle(0, arrays.ensure(this.data[0].colorHexValue)[0], this.data[0].cssClass);
90
91
  this.vennNumber1 = new VennCircle(this.$v1);
91
92
  this.vennReal1 = new VennCircle(this.$v1);
92
93
  }
93
94
  if (this.numberOfCircles > 1) {
94
- this.$v2 = this._createCircle(1, this.data[1].colorHexValue, this.data[1].cssClass);
95
+ this.$v2 = this._createCircle(1, arrays.ensure(this.data[1].colorHexValue)[0], this.data[1].cssClass);
95
96
  this.vennNumber2 = new VennCircle(this.$v2);
96
97
  this.vennReal2 = new VennCircle(this.$v2);
97
98
  }
98
99
  if (this.numberOfCircles > 2) {
99
- this.$v3 = this._createCircle(2, this.data[2].colorHexValue, this.data[2].cssClass);
100
+ this.$v3 = this._createCircle(2, arrays.ensure(this.data[2].colorHexValue)[0], this.data[2].cssClass);
100
101
  this.vennNumber3 = new VennCircle(this.$v3);
101
102
  this.vennReal3 = new VennCircle(this.$v3);
102
103
  }
@@ -49,6 +49,7 @@ export class ChartTableControl extends TableControl implements ChartTableControl
49
49
 
50
50
  constructor() {
51
51
  super();
52
+ this.iconId = icons.CHART;
52
53
  this.tooltipText = '${textKey:ui.Chart}';
53
54
  this.chartAggregation = {
54
55
  modifier: TableMatrix.NumberGroup.COUNT
@@ -361,7 +362,11 @@ export class ChartTableControl extends TableControl implements ChartTableControl
361
362
  }
362
363
 
363
364
  protected _hasColumns(): boolean {
364
- return this.table.columns.length !== 0;
365
+ return this._columns().length > 0;
366
+ }
367
+
368
+ protected _columns(): Column[] {
369
+ return new TableMatrix(this.table, this.session).columns();
365
370
  }
366
371
 
367
372
  protected _axisCount(columnCount: (number | Column<any>)[][], column: Column<any>): number {
@@ -861,7 +866,7 @@ export class ChartTableControl extends TableControl implements ChartTableControl
861
866
  }
862
867
 
863
868
  protected _handleIconLabel(label: string, axis: TableMatrixKeyAxis, iconClasses: string[]): string {
864
- if (axis && axis.textIsIcon) {
869
+ if (axis && axis.isIcon) {
865
870
  let icon = icons.parseIconId(label);
866
871
  if (icon && icon.isFontIcon()) {
867
872
  iconClasses.push(...icon.appendCssClass('font-icon').split(' '));
@@ -977,7 +982,7 @@ export class ChartTableControl extends TableControl implements ChartTableControl
977
982
  }
978
983
  }
979
984
  label = axis.format(label as number);
980
- if (axis.textIsIcon) {
985
+ if (axis.isIcon) {
981
986
  let icon = icons.parseIconId(label);
982
987
  if (icon && icon.isFontIcon()) {
983
988
  label = icon.iconCharacter;
@@ -1204,7 +1209,7 @@ export class ChartTableControl extends TableControl implements ChartTableControl
1204
1209
  }
1205
1210
 
1206
1211
  return {
1207
- text: '[' + (this.table.visibleColumns().indexOf(column) + 1) + ']'
1212
+ text: '[' + (this._columns().indexOf(column) + 1) + ']'
1208
1213
  };
1209
1214
  }
1210
1215