@eclipse-scout/chart 22.0.33 → 22.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/file-list CHANGED
@@ -1,6 +1,6 @@
1
- eclipse-scout-chart-0677e5a0d5ac4456cdf5.min.js
2
- eclipse-scout-chart-0677e5a0d5ac4456cdf5.min.js.LICENSE.txt
3
- eclipse-scout-chart-0677e5a0d5ac4456cdf5.min.js.map
1
+ eclipse-scout-chart-bc08151d11e1909eff6c.min.js
2
+ eclipse-scout-chart-bc08151d11e1909eff6c.min.js.LICENSE.txt
3
+ eclipse-scout-chart-bc08151d11e1909eff6c.min.js.map
4
4
  eclipse-scout-chart-theme-79622289bda68b525e3e.min.css
5
5
  eclipse-scout-chart-theme-dark-1de09c03e3dc40a9529a.min.css
6
6
  eclipse-scout-chart-theme-dark.css
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-scout/chart",
3
- "version": "22.0.33",
3
+ "version": "22.0.37",
4
4
  "description": "Eclipse Scout chart",
5
5
  "author": "BSI Business Systems Integration AG",
6
6
  "homepage": "https://www.eclipse.org/scout",
@@ -25,13 +25,13 @@
25
25
  "src"
26
26
  ],
27
27
  "devDependencies": {
28
- "@eclipse-scout/cli": "22.0.33",
28
+ "@eclipse-scout/cli": "22.0.37",
29
29
  "@eclipse-scout/releng": "^22.0.0",
30
30
  "jasmine-core": "3.10.1",
31
31
  "karma": "6.3.20"
32
32
  },
33
33
  "dependencies": {
34
- "@eclipse-scout/core": "22.0.33",
34
+ "@eclipse-scout/core": "22.0.37",
35
35
  "jquery": "3.6.0",
36
36
  "chart.js": "3.7.0",
37
37
  "chartjs-plugin-datalabels": "2.0.0"
@@ -1046,8 +1046,7 @@ export default class ChartJsRenderer extends AbstractChartRenderer {
1046
1046
  origin = graphics.offsetBounds(this.$canvas);
1047
1047
  origin.x += tooltip.caretX + positionAndOffset.offsetX;
1048
1048
  origin.y += tooltip.caretY + positionAndOffset.offsetY;
1049
- // Tooltip adds origin.height to origin.y in 'bottom' mode, but origin.y is already the correct value for 'top' and 'bottom' mode
1050
- origin.height = 0;
1049
+ origin.height = positionAndOffset.height;
1051
1050
 
1052
1051
  this._tooltip = scout.create({
1053
1052
  objectType: 'Tooltip',
@@ -1090,7 +1089,8 @@ export default class ChartJsRenderer extends AbstractChartRenderer {
1090
1089
  let tooltipPosition = 'top',
1091
1090
  tooltipDirection = 'right',
1092
1091
  offsetX = 0,
1093
- offsetY = 0;
1092
+ offsetY = 0,
1093
+ height = 0;
1094
1094
 
1095
1095
  let chart = tooltipItem.chart,
1096
1096
  datasetIndex = tooltipItem.datasetIndex,
@@ -1137,8 +1137,8 @@ export default class ChartJsRenderer extends AbstractChartRenderer {
1137
1137
  * @type BarElement
1138
1138
  */
1139
1139
  let element = chart.getDatasetMeta(datasetIndex).data[dataIndex];
1140
- let height = element.height,
1141
- width = element.width,
1140
+ height = element.height;
1141
+ let width = element.width,
1142
1142
  // golden ratio: (a + b) / a = a / b = PHI
1143
1143
  // and a + b = width
1144
1144
  // -> b = width / (PHI + 1)
@@ -1158,7 +1158,8 @@ export default class ChartJsRenderer extends AbstractChartRenderer {
1158
1158
  offset += value.r;
1159
1159
  }
1160
1160
 
1161
- offsetY = tooltipPosition === 'top' ? -offset : offset;
1161
+ height = 2 * offset;
1162
+ offsetY = -offset;
1162
1163
  } else if (scout.isOneOf(config.type, Chart.Type.PIE, Chart.Type.DOUGHNUT, Chart.Type.POLAR_AREA)) {
1163
1164
  // noinspection JSValidateTypes
1164
1165
  /**
@@ -1175,12 +1176,7 @@ export default class ChartJsRenderer extends AbstractChartRenderer {
1175
1176
  offsetY = offset * Math.sin(angle);
1176
1177
  }
1177
1178
 
1178
- return {
1179
- tooltipPosition: tooltipPosition,
1180
- tooltipDirection: tooltipDirection,
1181
- offsetX: offsetX,
1182
- offsetY: offsetY
1183
- };
1179
+ return {tooltipPosition, tooltipDirection, offsetX, offsetY, height};
1184
1180
  }
1185
1181
 
1186
1182
  _adjustGrid(config) {
@@ -1,14 +1,14 @@
1
1
  /*
2
- * Copyright (c) 2010-2021 BSI Business Systems Integration AG.
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
10
10
  */
11
- import {strings} from '@eclipse-scout/core';
11
+ import {objects, strings} from '@eclipse-scout/core';
12
12
  import {AbstractSvgChartRenderer} from '../index';
13
13
  import $ from 'jquery';
14
14
 
@@ -344,13 +344,10 @@ export default class SalesfunnelChartRenderer extends AbstractSvgChartRenderer {
344
344
  }
345
345
 
346
346
  _calcConversionRate(valueBefore, value) {
347
- let returnValue = 0;
348
- if (valueBefore === 0) {
349
- returnValue = undefined;
350
- } else if (value !== valueBefore) {
351
- returnValue = Math.round(value / valueBefore * 100);
347
+ if (objects.isNullOrUndefined(valueBefore) || objects.isNullOrUndefined(value) || valueBefore === 0) {
348
+ return undefined;
352
349
  }
353
- return returnValue;
350
+ return Math.round(value / valueBefore * 100);
354
351
  }
355
352
 
356
353
  _analyzeData(valueGroups) {