@syncfusion/ej2-treemap 20.1.55 → 20.2.38

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.
@@ -198,7 +198,7 @@ __decorate$1([
198
198
  class SubTitleSettings extends CommonTitleSettings {
199
199
  }
200
200
  __decorate$1([
201
- Complex({ size: '14px' }, Font)
201
+ Complex({ fontFamily: null }, Font)
202
202
  ], SubTitleSettings.prototype, "textStyle", void 0);
203
203
  __decorate$1([
204
204
  Property('Center')
@@ -209,7 +209,7 @@ __decorate$1([
209
209
  class TitleSettings extends CommonTitleSettings {
210
210
  }
211
211
  __decorate$1([
212
- Complex({ size: '15px' }, Font)
212
+ Complex({ fontFamily: null }, Font)
213
213
  ], TitleSettings.prototype, "textStyle", void 0);
214
214
  __decorate$1([
215
215
  Property('Center')
@@ -270,7 +270,7 @@ __decorate$1([
270
270
  Property('')
271
271
  ], LegendSettings.prototype, "height", void 0);
272
272
  __decorate$1([
273
- Complex({ size: '13px' }, Font)
273
+ Complex({ fontFamily: null }, Font)
274
274
  ], LegendSettings.prototype, "textStyle", void 0);
275
275
  __decorate$1([
276
276
  Property(null)
@@ -1252,7 +1252,7 @@ function removeClassNames(elements, type, treemap) {
1252
1252
  for (let j = 0; j < elements.length; j++) {
1253
1253
  element = isNullOrUndefined(elements[j].childNodes[0]) ? elements[j] :
1254
1254
  elements[j].childNodes[0];
1255
- options = treemap.layout.renderItems[element.id.split('_')[6]]['options'];
1255
+ options = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])]['options'];
1256
1256
  applyOptions(element, options);
1257
1257
  elements[j].classList.remove(type);
1258
1258
  j -= 1;
@@ -2111,9 +2111,11 @@ class LayoutPanel {
2111
2111
  }
2112
2112
  if (template) {
2113
2113
  templateEle = this.renderTemplate(secondaryEle, groupId, rect, templatePosition, template, item, isLeafItem);
2114
- templateGroup.appendChild(templateEle);
2115
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2116
- this.treemap.renderReactTemplates();
2114
+ if (!isNullOrUndefined(templateEle)) {
2115
+ templateGroup.appendChild(templateEle);
2116
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2117
+ this.treemap.renderReactTemplates();
2118
+ }
2117
2119
  }
2118
2120
  itemGroup.setAttribute('aria-label', item['name']);
2119
2121
  itemGroup.setAttribute('tabindex', (this.treemap.tabIndex + i + 2).toString());
@@ -2248,15 +2250,18 @@ class LayoutPanel {
2248
2250
  template = template.replace(new RegExp('{{:' + keys[i] + '}}', 'g'), item['data'][keys[i].toString()]);
2249
2251
  }
2250
2252
  }
2251
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2252
- const templateFn = getTemplateFunction(template);
2253
- const templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
2254
- const labelEle = convertElement(templateElement, templateId, item['data']);
2255
- const templateSize = measureElement(labelEle, secondaryEle);
2256
- const templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
2257
- labelEle.style.left = templateLocation.x + 'px';
2258
- labelEle.style.top = templateLocation.y + 'px';
2259
- return labelEle;
2253
+ let labelElement;
2254
+ if (!isNullOrUndefined(document.getElementById(this.treemap.element.id + '_Secondary_Element'))) {
2255
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2256
+ const templateFn = getTemplateFunction(template);
2257
+ const templateElement = templateFn(item['data'], this.treemap, template, this.treemap.element.id + baseTemplateId, false);
2258
+ labelElement = convertElement(templateElement, templateId, item['data']);
2259
+ const templateSize = measureElement(labelElement, secondaryEle);
2260
+ const templateLocation = findLabelLocation(rect, position, templateSize, 'Template', this.treemap);
2261
+ labelElement.style.left = templateLocation.x + 'px';
2262
+ labelElement.style.top = templateLocation.y + 'px';
2263
+ }
2264
+ return labelElement;
2260
2265
  }
2261
2266
  labelInterSectAction(rect, text, textStyle, alignment) {
2262
2267
  let textValue;
@@ -2329,6 +2334,9 @@ function getThemeStyle(theme) {
2329
2334
  tooltipFontColor: '#ffffff',
2330
2335
  legendTitleColor: '#DADADA',
2331
2336
  legendTextColor: '#DADADA',
2337
+ fontSize: '15px',
2338
+ subtitleFontSize: '14px',
2339
+ legendFontSize: '13px',
2332
2340
  fontFamily: 'Roboto, Noto, Sans-serif'
2333
2341
  };
2334
2342
  break;
@@ -2341,6 +2349,9 @@ function getThemeStyle(theme) {
2341
2349
  tooltipFontColor: '#ffffff',
2342
2350
  legendTitleColor: '#FFFFFF',
2343
2351
  legendTextColor: '#FFFFFF',
2352
+ fontSize: '15px',
2353
+ subtitleFontSize: '14px',
2354
+ legendFontSize: '13px',
2344
2355
  fontFamily: 'Roboto, Noto, Sans-serif'
2345
2356
  };
2346
2357
  break;
@@ -2357,6 +2368,7 @@ function getThemeStyle(theme) {
2357
2368
  legendTextColor: '#212529',
2358
2369
  fontFamily: 'HelveticaNeue-Medium',
2359
2370
  fontSize: '16px',
2371
+ subtitleFontSize: '14px',
2360
2372
  legendFontSize: '14px',
2361
2373
  labelFontFamily: 'HelveticaNeue'
2362
2374
  };
@@ -2374,6 +2386,7 @@ function getThemeStyle(theme) {
2374
2386
  legendTextColor: '#374151',
2375
2387
  fontFamily: 'Inter',
2376
2388
  fontSize: '14px',
2389
+ subtitleFontSize: '12px',
2377
2390
  legendFontSize: '12px',
2378
2391
  labelFontFamily: 'Inter'
2379
2392
  };
@@ -2391,6 +2404,7 @@ function getThemeStyle(theme) {
2391
2404
  legendTextColor: '#D1D5DB',
2392
2405
  fontFamily: 'Inter',
2393
2406
  fontSize: '14px',
2407
+ subtitleFontSize: '12px',
2394
2408
  legendFontSize: '12px',
2395
2409
  labelFontFamily: 'Inter'
2396
2410
  };
@@ -2408,6 +2422,7 @@ function getThemeStyle(theme) {
2408
2422
  legendTextColor: '#212529',
2409
2423
  fontFamily: 'Helvetica Neue',
2410
2424
  fontSize: '14px',
2425
+ subtitleFontSize: '12px',
2411
2426
  legendFontSize: '12px',
2412
2427
  labelFontFamily: 'Helvetica Neue'
2413
2428
  };
@@ -2425,6 +2440,7 @@ function getThemeStyle(theme) {
2425
2440
  legendTextColor: '#FFFFFF',
2426
2441
  fontFamily: 'Helvetica Neue',
2427
2442
  fontSize: '14px',
2443
+ subtitleFontSize: '12px',
2428
2444
  legendFontSize: '12px',
2429
2445
  labelFontFamily: 'Helvetica Neue'
2430
2446
  };
@@ -2442,6 +2458,7 @@ function getThemeStyle(theme) {
2442
2458
  legendTextColor: '#201F1E',
2443
2459
  fontFamily: 'Segoe UI',
2444
2460
  fontSize: '14px',
2461
+ subtitleFontSize: '12px',
2445
2462
  legendFontSize: '12px',
2446
2463
  labelFontFamily: 'Segoe UI'
2447
2464
  };
@@ -2459,6 +2476,7 @@ function getThemeStyle(theme) {
2459
2476
  legendTextColor: '#F3F2F1',
2460
2477
  fontFamily: 'Segoe UI',
2461
2478
  fontSize: '14px',
2479
+ subtitleFontSize: '12px',
2462
2480
  legendFontSize: '12px',
2463
2481
  labelFontFamily: 'Segoe UI'
2464
2482
  };
@@ -2472,6 +2490,9 @@ function getThemeStyle(theme) {
2472
2490
  tooltipFontColor: '#ffffff',
2473
2491
  legendTitleColor: '#353535',
2474
2492
  legendTextColor: '#353535',
2493
+ fontSize: '15px',
2494
+ subtitleFontSize: '14px',
2495
+ legendFontSize: '13px',
2475
2496
  fontFamily: 'Roboto, Noto, Sans-serif'
2476
2497
  };
2477
2498
  break;
@@ -2896,7 +2917,8 @@ let TreeMap = class TreeMap extends Component {
2896
2917
  }
2897
2918
  elementChange() {
2898
2919
  if (this.treeMapLegendModule && this.legendSettings.visible && this.treeMapLegendModule.legendGroup && this.layout.layoutGroup
2899
- && !isNullOrUndefined(this.svgObject)) {
2920
+ && !isNullOrUndefined(this.svgObject) && !isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))
2921
+ && !isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))) {
2900
2922
  this.svgObject.insertBefore(this.layout.layoutGroup, this.treeMapLegendModule.legendGroup);
2901
2923
  }
2902
2924
  }
@@ -2918,12 +2940,15 @@ let TreeMap = class TreeMap extends Component {
2918
2940
  }
2919
2941
  }
2920
2942
  renderTitle(title, type, bounds, groupEle) {
2921
- const style = title.textStyle;
2943
+ const style = {
2944
+ color: title.textStyle.color, size: title.textStyle.size, fontFamily: title.textStyle.fontFamily,
2945
+ fontStyle: title.textStyle.fontStyle, fontWeight: title.textStyle.fontWeight, opacity: title.textStyle.opacity
2946
+ };
2922
2947
  let height;
2923
2948
  const titlePadding = 10;
2924
2949
  const width = (this.availableSize.width - this.margin.right - this.margin.left);
2925
- title.textStyle.fontFamily = this.themeStyle.fontFamily || title.textStyle.fontFamily;
2926
- title.textStyle.size = this.themeStyle.fontSize || title.textStyle.size;
2950
+ style.fontFamily = style.fontFamily || this.themeStyle.fontFamily;
2951
+ style.size = style.size || (type === 'title' ? this.themeStyle.fontSize : this.themeStyle.subtitleFontSize);
2927
2952
  if (title.text) {
2928
2953
  if (isNullOrUndefined(groupEle)) {
2929
2954
  groupEle = this.renderer.createGroup({ id: this.element.id + '_Title_Group' });
@@ -3344,7 +3369,7 @@ let TreeMap = class TreeMap extends Component {
3344
3369
  this.trigger(click, clickArgs);
3345
3370
  if (targetId.indexOf('_Item_Index') > -1) {
3346
3371
  e.preventDefault();
3347
- itemIndex = parseFloat(targetId.split('_')[6]);
3372
+ itemIndex = parseFloat(targetId.split('_Item_Index_')[1]);
3348
3373
  eventArgs = {
3349
3374
  cancel: false, name: itemClick, treemap: this, item: this.layout.renderItems[itemIndex], mouseEvent: e,
3350
3375
  groupIndex: this.layout.renderItems[itemIndex]['groupIndex'], groupName: this.layout.renderItems[itemIndex]['name'],
@@ -3417,7 +3442,7 @@ let TreeMap = class TreeMap extends Component {
3417
3442
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3418
3443
  let childItems;
3419
3444
  if (targetId.indexOf('_Item_Index') > -1) {
3420
- item = this.layout.renderItems[parseFloat(targetId.split('_')[6])];
3445
+ item = this.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
3421
3446
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3422
3447
  childItems = findChildren(item)['values'];
3423
3448
  this.element.style.cursor = (!item['isLeafItem'] && childItems && childItems.length > 0 && this.enableDrillDown) ?
@@ -3542,7 +3567,7 @@ let TreeMap = class TreeMap extends Component {
3542
3567
  if (e.cancelable) {
3543
3568
  e.preventDefault();
3544
3569
  }
3545
- index = parseFloat(targetId.split('_')[6]);
3570
+ index = parseFloat(targetId.split('_Item_Index_')[1]);
3546
3571
  item = this.layout.renderItems[index];
3547
3572
  const labelText = targetEle.innerHTML;
3548
3573
  if (this.enableBreadcrumb) {
@@ -4075,8 +4100,8 @@ class TreeMapLegend {
4075
4100
  const shapePadding = legend.shapePadding;
4076
4101
  const itemTextStyle = legend.textStyle;
4077
4102
  const legendLength = this.legendCollections.length;
4078
- legend.textStyle.size = treemap.themeStyle.legendFontSize || legend.textStyle.size;
4079
- legend.textStyle.fontFamily = treemap.themeStyle.fontFamily || legend.textStyle.fontFamily;
4103
+ itemTextStyle.size = itemTextStyle.size || treemap.themeStyle.legendFontSize;
4104
+ itemTextStyle.fontFamily = itemTextStyle.fontFamily || treemap.themeStyle.fontFamily;
4080
4105
  if (legendMode === 'Default') {
4081
4106
  legendWidth = (isNullOrUndefined(legendWidth)) ? treemap.areaRect.width : legendWidth;
4082
4107
  legendHeight = (isNullOrUndefined(legendHeight)) ? treemap.areaRect.height : legendHeight;
@@ -4087,7 +4112,7 @@ class TreeMapLegend {
4087
4112
  if (isNullOrUndefined(this.totalPages[this.page])) {
4088
4113
  this.totalPages[this.page] = { Page: (this.page + 1), Collection: [] };
4089
4114
  }
4090
- const legendTextSize = measureText(legendItem['legendName'], legend.textStyle);
4115
+ const legendTextSize = measureText(legendItem['legendName'], itemTextStyle);
4091
4116
  this.textMaxWidth = Math.max(this.textMaxWidth, legendTextSize.width);
4092
4117
  if (i === 0) {
4093
4118
  startX = shapeX = (leftPadding + (shapeWidth / 2));
@@ -4184,7 +4209,6 @@ class TreeMapLegend {
4184
4209
  };
4185
4210
  }
4186
4211
  else {
4187
- const itemTextStyle = legend.textStyle;
4188
4212
  const legendLength = this.legendCollections.length;
4189
4213
  const rectWidth = (orientation === 'Horizontal') ? (isNullOrUndefined(legendWidth)) ? (treemap.areaRect.width / legendLength) :
4190
4214
  (legendWidth / legendLength) : (isNullOrUndefined(legendWidth)) ? defaultSize : legendWidth;
@@ -4741,7 +4765,7 @@ class TreeMapLegend {
4741
4765
  let stroke;
4742
4766
  let strokeWidth;
4743
4767
  let legendElement;
4744
- targetItem = treemap.layout.renderItems[parseFloat(target.id.split('_')[6])];
4768
+ targetItem = treemap.layout.renderItems[parseFloat(target.id.split('_Item_Index_')[1])];
4745
4769
  const svgRect = treemap.svgObject.getBoundingClientRect();
4746
4770
  for (let i = 0; i < this.legendCollections.length; i++) {
4747
4771
  currentData = this.legendCollections[i];
@@ -5014,14 +5038,14 @@ class TreeMapHighlight {
5014
5038
  if (this.highLightId !== targetId) {
5015
5039
  treeMapElement = document.getElementById(treemap.element.id + '_TreeMap_' + treemap.layoutType + '_Layout');
5016
5040
  const selectionElements = document.getElementsByClassName('treeMapSelection');
5017
- item = this.treemap.layout.renderItems[parseFloat(targetId.split('_')[6])];
5041
+ item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
5018
5042
  let index;
5019
5043
  if (this.treemap.legendSettings.visible) {
5020
5044
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5021
5045
  const collection = this.treemap.treeMapLegendModule.legendCollections;
5022
5046
  const length = this.treemap.treeMapLegendModule.legendCollections.length;
5023
5047
  index = getLegendIndex(length, item, treemap);
5024
- this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('container_Legend_Shape_Index_' + index) : document.getElementById('container_Legend_Index_' + index);
5048
+ this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
5025
5049
  if (this.shapeElement !== null && (selectionModule ? this.shapeElement.getAttribute('id') !== selectionModule.legendSelectId : true)) {
5026
5050
  if (selectionModule ? this.shapeElement !== selectionModule.shapeElement : true) {
5027
5051
  this.currentElement.push({ currentElement: this.shapeElement });
@@ -5049,7 +5073,7 @@ class TreeMapHighlight {
5049
5073
  for (let i = 0; i < treeMapElement.childElementCount; i++) {
5050
5074
  element = treeMapElement.childNodes[i];
5051
5075
  process = true;
5052
- item = treemap.layout.renderItems[element.id.split('_')[6]];
5076
+ item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
5053
5077
  for (let j = 0; j < selectionElements.length; j++) {
5054
5078
  if (element.id === selectionElements[j].id) {
5055
5079
  process = false;
@@ -5087,7 +5111,7 @@ class TreeMapHighlight {
5087
5111
  removeLegend(this.legendHighlightCollection, 'highlight');
5088
5112
  }
5089
5113
  this.shapeTarget = 'highlight';
5090
- const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_')[4]) : parseFloat(targetId.split('_')[3]);
5114
+ const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
5091
5115
  const dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
5092
5116
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5093
5117
  const collection = this.treemap.treeMapLegendModule.legendCollections;
@@ -5097,7 +5121,7 @@ class TreeMapHighlight {
5097
5121
  if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][i]['levelOrderName'] === this.treemap.layout.renderItems[j]['levelOrderName']) {
5098
5122
  itemIndex = j;
5099
5123
  groupIndex = this.treemap.layout.renderItems[j]['groupIndex'];
5100
- const nodeEle = document.getElementById('container_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
5124
+ const nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
5101
5125
  if (i === 0) {
5102
5126
  this.legendHighlightCollection = [];
5103
5127
  pushCollection(this.legendHighlightCollection, legendIndex, j, targetEle, nodeEle, this.treemap.layout.renderItems, collection);
@@ -5218,7 +5242,7 @@ class TreeMapSelection {
5218
5242
  e.preventDefault();
5219
5243
  if (this.treemap.selectionId !== targetId && this.legendSelect) {
5220
5244
  treeMapElement = document.getElementById(layoutID);
5221
- item = treemap.layout.renderItems[parseFloat(targetId.split('_')[6])];
5245
+ item = treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
5222
5246
  let index;
5223
5247
  if (this.treemap.legendSettings.visible) {
5224
5248
  this.shapeSelect = false;
@@ -5232,7 +5256,7 @@ class TreeMapSelection {
5232
5256
  highlightModule.shapeHighlightCollection = [];
5233
5257
  }
5234
5258
  index = getLegendIndex(length, item, treemap);
5235
- this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('container_Legend_Shape_Index_' + index) : document.getElementById('container_Legend_Index_' + index);
5259
+ this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
5236
5260
  if (this.shapeElement !== null) {
5237
5261
  this.shapeSelectId = this.shapeElement.getAttribute('id');
5238
5262
  this.shapeSelectionCollection.push({ legendEle: this.shapeElement, oldFill: collection[index]['legendFill'],
@@ -5245,7 +5269,7 @@ class TreeMapSelection {
5245
5269
  orders = findHightLightItems(item, [], selection.mode, treemap);
5246
5270
  for (let i = 0; i < treeMapElement.childElementCount; i++) {
5247
5271
  element = treeMapElement.childNodes[i];
5248
- item = treemap.layout.renderItems[element.id.split('_')[6]];
5272
+ item = treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
5249
5273
  if (orders.indexOf(item['levelOrderName']) > -1) {
5250
5274
  selectionElements.push(element);
5251
5275
  treemap.levelSelection.push(element.id);
@@ -5305,14 +5329,14 @@ class TreeMapSelection {
5305
5329
  if (highlightModule) {
5306
5330
  highlightModule.shapeTarget = 'selection';
5307
5331
  }
5308
- const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_')[4]) : parseFloat(targetId.split('_')[3]);
5332
+ const index = this.treemap.legendSettings.mode === 'Default' ? parseFloat(targetId.split('_Legend_Shape_Index_')[1]) : parseFloat(targetId.split('_Legend_Index_')[1]);
5309
5333
  const dataLength = this.treemap.treeMapLegendModule.legendCollections[index]['legendData'].length;
5310
5334
  for (let k = 0; k < dataLength; k++) {
5311
5335
  for (let l = 0; l < this.treemap.layout.renderItems.length; l++) {
5312
5336
  if (this.treemap.treeMapLegendModule.legendCollections[index]['legendData'][k]['levelOrderName'] === this.treemap.layout.renderItems[l]['levelOrderName']) {
5313
5337
  itemIndex = l;
5314
5338
  groupIndex = this.treemap.layout.renderItems[l]['groupIndex'];
5315
- const nodeEle = document.getElementById('container_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
5339
+ const nodeEle = document.getElementById(this.treemap.element.id + '_Level_Index_' + groupIndex + '_Item_Index_' + itemIndex + '_RectPath');
5316
5340
  if (k === 0) {
5317
5341
  pushCollection(this.legendSelectionCollection, legendIndex, l, targetEle, nodeEle, this.treemap.layout.renderItems, collection);
5318
5342
  length = this.legendSelectionCollection.length;
@@ -5364,7 +5388,7 @@ class TreeMapSelection {
5364
5388
  const orders = findHightLightItems(item, [], selection.mode, this.treemap);
5365
5389
  for (let i = 0; i < treeMapElement.childElementCount; i++) {
5366
5390
  element = treeMapElement.childNodes[i];
5367
- item = this.treemap.layout.renderItems[element.id.split('_')[6]];
5391
+ item = this.treemap.layout.renderItems[parseFloat(element.id.split('_Item_Index_')[1])];
5368
5392
  if (orders.indexOf(item['levelOrderName']) > -1) {
5369
5393
  selectionElements.push(element);
5370
5394
  this.treemap.levelSelection.push(element.id);
@@ -5380,7 +5404,7 @@ class TreeMapSelection {
5380
5404
  this.shapeElement = undefined;
5381
5405
  removeShape(this.shapeSelectionCollection, 'selection');
5382
5406
  index = getLegendIndex(length, items[m], this.treemap);
5383
- this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById('container_Legend_Shape_Index_' + index) : document.getElementById('container_Legend_Index_' + index);
5407
+ this.shapeElement = this.treemap.legendSettings.mode === 'Default' ? document.getElementById(this.treemap.element.id + '_Legend_Shape_Index_' + index) : document.getElementById(this.treemap.element.id + '_Legend_Index_' + index);
5384
5408
  if (this.shapeElement !== null) {
5385
5409
  this.shapeSelectId = this.shapeElement.getAttribute('id');
5386
5410
  this.treemap.legendId.push(this.shapeSelectId);
@@ -5521,7 +5545,7 @@ class TreeMapTooltip {
5521
5545
  let tooltipContent = [];
5522
5546
  let markerFill;
5523
5547
  if (targetId.indexOf('_Item_Index') > -1) {
5524
- item = this.treemap.layout.renderItems[parseFloat(targetId.split('_')[6])];
5548
+ item = this.treemap.layout.renderItems[parseFloat(targetId.split('_Item_Index_')[1])];
5525
5549
  if (!isNullOrUndefined(item)) {
5526
5550
  toolTipHeader = item['name'];
5527
5551
  value = item['weight'];