@carbon/charts-vue 1.6.9 → 1.6.13

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/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.6.13](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.12...v1.6.13) (2023-03-07)
7
+
8
+ **Note:** Version bump only for package @carbon/charts-vue
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.6.12](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.11...v1.6.12) (2023-03-06)
15
+
16
+ **Note:** Version bump only for package @carbon/charts-vue
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.6.11](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.10...v1.6.11) (2023-03-06)
23
+
24
+ **Note:** Version bump only for package @carbon/charts-vue
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.6.10](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.9...v1.6.10) (2023-03-06)
31
+
32
+ **Note:** Version bump only for package @carbon/charts-vue
33
+
34
+
35
+
36
+
37
+
6
38
  ## [1.6.9](https://github.com/carbon-design-system/carbon-charts/compare/v1.6.8...v1.6.9) (2023-03-03)
7
39
 
8
40
  **Note:** Version bump only for package @carbon/charts-vue
@@ -24127,7 +24127,14 @@ var tooltip_Tooltip = /** @class */ (function (_super) {
24127
24127
  _this.positionService = new utils_position();
24128
24128
  _this.handleShowTooltip = function (e) {
24129
24129
  var data = e.detail.data || e.detail.items;
24130
- var defaultHTML = _this.getTooltipHTML(e);
24130
+ var defaultHTML;
24131
+ var formattedItems = _this.formatItems(_this.getItems(e));
24132
+ if (e.detail.content) {
24133
+ defaultHTML = "<div class=\"title-tooltip\"><p>" + e.detail.content + "</p></div>";
24134
+ }
24135
+ else {
24136
+ defaultHTML = _this.getTooltipHTML(formattedItems);
24137
+ }
24131
24138
  var tooltipTextContainer = dom_utils_DOMUtils.appendOrSelect(_this.tooltip, 'div.content-box');
24132
24139
  // if there is a provided tooltip HTML function call it
24133
24140
  if (tools_Tools.getProperty(_this.getOptions(), 'tooltip', 'customHTML')) {
@@ -24145,6 +24152,18 @@ var tooltip_Tooltip = /** @class */ (function (_super) {
24145
24152
  // Use default tooltip
24146
24153
  tooltipTextContainer.html(defaultHTML);
24147
24154
  }
24155
+ // Apply custom background colors
24156
+ tooltipTextContainer
24157
+ .selectAll('.datapoint-tooltip')
24158
+ .each(function (datum, i) {
24159
+ var item = formattedItems[i];
24160
+ if (formattedItems[i] && formattedItems[i].color) {
24161
+ src_select(this)
24162
+ .select('.tooltip-color')
24163
+ .attr('class', 'tooltip-color')
24164
+ .style('background-color', item.color);
24165
+ }
24166
+ });
24148
24167
  // Position the tooltip
24149
24168
  _this.positionTooltip(e);
24150
24169
  // Fade in
@@ -24215,31 +24234,18 @@ var tooltip_Tooltip = /** @class */ (function (_super) {
24215
24234
  }
24216
24235
  return items;
24217
24236
  };
24218
- Tooltip.prototype.getTooltipHTML = function (e) {
24219
- var defaultHTML;
24220
- if (e.detail.content) {
24221
- defaultHTML = "<div class=\"title-tooltip\"><p>" + e.detail.content + "</p></div>";
24222
- }
24223
- else {
24224
- var items = this.getItems(e);
24225
- var formattedItems = this.formatItems(items);
24226
- defaultHTML =
24227
- "<ul class=\"multi-tooltip\">" +
24228
- formattedItems
24229
- .map(function (item) {
24230
- return "<li>\n\t\t\t\t\t\t\t<div class=\"datapoint-tooltip " + (item.bold ? 'bold' : '') + "\">\n\t\t\t\t\t\t\t\t" + (item.class ? "<div class=\"tooltip-color " + item.class + "\"></div>" : '') + "\n\t\t\t\t\t\t\t\t" + (item.color
24231
- ? '<div style="background-color: ' +
24232
- item.color +
24233
- '" class="tooltip-color"></div>'
24234
- : '') + "\n\t\t\t\t\t\t\t\t<div class=\"label\">\n\t\t\t\t\t\t\t\t<p>" + (item.label || '') + "</p>\n\t\t\t\t\t\t\t\t" + (item.labelIcon ? "<span class=\"label-icon\"/>" + item.labelIcon + "</span>" : '') + "\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t" + (item.value === undefined ||
24235
- item.value === null
24236
- ? ''
24237
- : "<p class=\"value\"/>" + item.value + "</p>") + "\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>";
24238
- })
24239
- .join('') +
24240
- "</ul>";
24241
- }
24242
- return defaultHTML;
24237
+ Tooltip.prototype.getTooltipHTML = function (formattedItems) {
24238
+ return ("<ul class=\"multi-tooltip\">" +
24239
+ formattedItems
24240
+ .map(function (item) {
24241
+ return "<li>\n\t\t\t\t\t<div class=\"datapoint-tooltip" + (item.bold ? ' bold' : '') + "\">\n\t\t\t\t\t\t" + (item.class || item.color
24242
+ ? "<div class=\"tooltip-color " + item.class + "\"></div>"
24243
+ : '') + "\n\t\t\t\t\t\t<div class=\"label\">\n\t\t\t\t\t\t<p>" + (item.label || '') + "</p>\n\t\t\t\t\t\t" + (item.labelIcon ? "<span class=\"label-icon\"/>" + item.labelIcon + "</span>" : '') + "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t" + (item.value === undefined || item.value === null
24244
+ ? ''
24245
+ : "<p class=\"value\"/>" + item.value + "</p>") + "\n\t\t\t\t\t</div>\n\t\t\t\t</li>";
24246
+ })
24247
+ .join('') +
24248
+ "</ul>");
24243
24249
  };
24244
24250
  Tooltip.prototype.valueFormatter = function (value, label) {
24245
24251
  var options = this.getOptions();
@@ -36366,13 +36372,13 @@ var axis_Axis = /** @class */ (function (_super) {
36366
36372
  container
36367
36373
  .selectAll('g.ticks g.tick text')
36368
36374
  .attr('transform', "rotate(-45)")
36369
- .style('text-anchor', axisPosition === AxisPositions.TOP ? 'start' : 'end');
36375
+ .attr('text-anchor', axisPosition === AxisPositions.TOP ? 'start' : 'end');
36370
36376
  }
36371
36377
  else {
36372
36378
  container
36373
36379
  .selectAll('g.ticks g.tick text')
36374
36380
  .attr('transform', null)
36375
- .style('text-anchor', null);
36381
+ .attr('text-anchor', null);
36376
36382
  }
36377
36383
  }
36378
36384
  // we don't need to show axes on empty state and on skeleton state