@bizy/core 20.4.3 → 20.4.4

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.
@@ -323,7 +323,7 @@ class BizyBarLineChartComponent {
323
323
  #renderer = inject(Renderer2);
324
324
  resizeRef = null;
325
325
  tooltip = true;
326
- download = { show: true, label: 'Descargar', name: 'Bizy' };
326
+ download = null;
327
327
  axisPointer = 'line';
328
328
  xAxisLabels = [];
329
329
  onTooltipFormatter;
@@ -533,13 +533,15 @@ class BizyBarLineChartComponent {
533
533
  const textColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-bar-line-chart-tooltip-color');
534
534
  const textBackgroundColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-bar-line-chart-tooltip-background-color');
535
535
  const borderColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-bar-line-chart-tooltip-border-color');
536
+ const downloadTitle = this.download?.label || 'Descargar';
537
+ const downloadName = this.download?.name || 'bizy_chart';
536
538
  const toolbox = {
537
539
  show: true,
538
540
  feature: {
539
541
  mySaveAsImage: {
540
- show: this.download.show,
542
+ show: Boolean(this.download),
541
543
  icon: 'path://M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z',
542
- title: this.download.label,
544
+ title: downloadTitle,
543
545
  onclick: () => {
544
546
  const showAllLegends = (chart) => {
545
547
  const option = chart.getOption();
@@ -568,7 +570,7 @@ class BizyBarLineChartComponent {
568
570
  html2canvas(this.#chartContainer).then(canvas => {
569
571
  var link = this.#renderer.createElement('a');
570
572
  link.href = canvas.toDataURL('image/png');
571
- link.download = `${this.download.name}.png`;
573
+ link.download = downloadName;
572
574
  this.#renderer.appendChild(this.#document.body, link);
573
575
  link.click();
574
576
  this.#renderer.removeChild(this.#document.body, link);
@@ -3175,7 +3177,7 @@ class BizyHeatMapChartComponent {
3175
3177
  resizeRef = null;
3176
3178
  tooltip = true;
3177
3179
  ranges = [];
3178
- download = { show: true, label: 'Descargar', name: 'Bizy' };
3180
+ download = null;
3179
3181
  xAxisLabels = [];
3180
3182
  yAxisLabels = [];
3181
3183
  onTooltipFormatter;
@@ -3260,19 +3262,21 @@ class BizyHeatMapChartComponent {
3260
3262
  const textColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-tooltip-color');
3261
3263
  const textBackgroundColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-tooltip-background-color');
3262
3264
  const borderColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-heat-map-chart-tooltip-border-color');
3265
+ const downloadTitle = this.download?.label || 'Descargar';
3266
+ const downloadName = this.download?.name || 'bizy_chart';
3263
3267
  const toolbox = {
3264
3268
  show: true,
3265
3269
  feature: {
3266
3270
  mySaveAsImage: {
3267
- show: this.download.show,
3271
+ show: Boolean(this.download),
3268
3272
  icon: 'path://M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z',
3269
- title: this.download.label,
3273
+ title: downloadTitle,
3270
3274
  onclick: () => {
3271
3275
  setTimeout(() => {
3272
3276
  html2canvas(this.#chartContainer).then(canvas => {
3273
3277
  var link = this.#renderer.createElement('a');
3274
3278
  link.href = canvas.toDataURL('image/png');
3275
- link.download = `${this.download.name}.png`;
3279
+ link.download = downloadName;
3276
3280
  this.#renderer.appendChild(this.#document.body, link);
3277
3281
  link.click();
3278
3282
  this.#renderer.removeChild(this.#document.body, link);
@@ -3650,7 +3654,7 @@ class BizyPieChartComponent {
3650
3654
  centerLabel = null;
3651
3655
  type = 'pie';
3652
3656
  legend = null;
3653
- download = { show: true, label: 'Descargar', name: 'Bizy' };
3657
+ download = null;
3654
3658
  onLabelFormatter;
3655
3659
  onTooltipFormatter;
3656
3660
  onSelect = new EventEmitter();
@@ -3737,19 +3741,21 @@ class BizyPieChartComponent {
3737
3741
  const textColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-pie-chart-tooltip-color');
3738
3742
  const textBackgroundColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-pie-chart-tooltip-background-color');
3739
3743
  const borderColor = this.#getClosestCssVariable(this.#elementRef.nativeElement, '--bizy-pie-chart-tooltip-border-color');
3744
+ const downloadTitle = this.download?.label || 'Descargar';
3745
+ const downloadName = this.download?.name || 'bizy_chart';
3740
3746
  const toolbox = {
3741
3747
  show: true,
3742
3748
  feature: {
3743
3749
  mySaveAsImage: {
3744
- show: this.download.show,
3750
+ show: Boolean(this.download),
3745
3751
  icon: 'path://M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z',
3746
- title: this.download.label,
3752
+ title: downloadTitle,
3747
3753
  onclick: () => {
3748
3754
  setTimeout(() => {
3749
3755
  html2canvas(this.#chartContainer).then(canvas => {
3750
3756
  var link = this.#renderer.createElement('a');
3751
3757
  link.href = canvas.toDataURL('image/png');
3752
- link.download = `${this.download.name}.png`;
3758
+ link.download = downloadName;
3753
3759
  this.#renderer.appendChild(this.#document.body, link);
3754
3760
  link.click();
3755
3761
  this.#renderer.removeChild(this.#document.body, link);