@aquera/nile-visualization 1.9.0 → 2.1.0
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/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +4 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +12 -0
- package/dist/src/nile-area-chart/nile-area-chart.d.ts +2 -0
- package/dist/src/nile-area-chart/nile-area-chart.js +6 -1
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.d.ts +4 -0
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +12 -0
- package/dist/src/nile-area-range-chart/nile-area-range-chart.d.ts +4 -0
- package/dist/src/nile-area-range-chart/nile-area-range-chart.js +12 -0
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.d.ts +4 -0
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +12 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +2 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.js +9 -1
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.d.ts +2 -0
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +6 -1
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.d.ts +2 -0
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +6 -1
- package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +2 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +6 -1
- package/dist/src/nile-chart/nile-chart-config.d.ts +8 -4
- package/dist/src/nile-chart/nile-chart.js +110 -28
- package/dist/src/nile-cluster-chart/nile-cluster-chart.d.ts +2 -0
- package/dist/src/nile-cluster-chart/nile-cluster-chart.js +6 -1
- package/dist/src/nile-column-chart/nile-column-chart.d.ts +2 -0
- package/dist/src/nile-column-chart/nile-column-chart.js +6 -1
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.d.ts +4 -0
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +12 -1
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.d.ts +4 -0
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +13 -1
- package/dist/src/nile-column-range-chart/nile-column-range-chart.d.ts +4 -0
- package/dist/src/nile-column-range-chart/nile-column-range-chart.js +12 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +2 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +6 -0
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.d.ts +3 -0
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +6 -1
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.d.ts +3 -0
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +6 -1
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.d.ts +3 -0
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +6 -1
- package/dist/src/nile-euler-chart/nile-euler-chart.d.ts +4 -0
- package/dist/src/nile-euler-chart/nile-euler-chart.js +13 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.d.ts +3 -0
- package/dist/src/nile-fan-chart/nile-fan-chart.js +6 -1
- package/dist/src/nile-flame-chart/nile-flame-chart.d.ts +4 -0
- package/dist/src/nile-flame-chart/nile-flame-chart.js +12 -1
- package/dist/src/nile-funnel-chart/nile-funnel-chart.d.ts +4 -0
- package/dist/src/nile-funnel-chart/nile-funnel-chart.js +12 -1
- package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +4 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +13 -1
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +2 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +6 -1
- package/dist/src/nile-histogram-chart/nile-histogram-chart.d.ts +2 -0
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +6 -1
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.d.ts +4 -0
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +12 -0
- package/dist/src/nile-kpi-chart/nile-kpi-chart.d.ts +10 -0
- package/dist/src/nile-kpi-chart/nile-kpi-chart.js +36 -5
- package/dist/src/nile-line-chart/nile-line-chart.d.ts +2 -0
- package/dist/src/nile-line-chart/nile-line-chart.js +6 -1
- package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +4 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +12 -1
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.d.ts +4 -0
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +13 -2
- package/dist/src/nile-map-chart/nile-map-chart.d.ts +4 -0
- package/dist/src/nile-map-chart/nile-map-chart.js +12 -3
- package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +4 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.js +12 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +53 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.js +9 -0
- package/dist/src/nile-polygon-chart/nile-polygon-chart.d.ts +4 -0
- package/dist/src/nile-polygon-chart/nile-polygon-chart.js +12 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +2 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.js +6 -1
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.d.ts +2 -0
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +6 -1
- package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +2 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +6 -1
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.d.ts +2 -0
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +6 -1
- package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +2 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.js +6 -1
- package/dist/src/nile-stacked-chart/nile-stacked-chart.d.ts +2 -0
- package/dist/src/nile-stacked-chart/nile-stacked-chart.js +6 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.d.ts +3 -0
- package/dist/src/nile-timeline-chart/nile-timeline-chart.js +6 -1
- package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +4 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +12 -0
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.d.ts +2 -0
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +6 -1
- package/dist/src/nile-vector-chart/nile-vector-chart.d.ts +4 -0
- package/dist/src/nile-vector-chart/nile-vector-chart.js +12 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +2 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +6 -1
- package/dist/src/nile-xrange-chart/nile-xrange-chart.d.ts +2 -0
- package/dist/src/nile-xrange-chart/nile-xrange-chart.js +6 -1
- package/package.json +2 -2
|
@@ -162,9 +162,19 @@ let NileChart = class NileChart extends NileElement {
|
|
|
162
162
|
/** True when elements are projected into `header-actions` (used to show the header row). */
|
|
163
163
|
this.hasHeaderActionsSlot = false;
|
|
164
164
|
this.handleOutsideClick = (e) => {
|
|
165
|
-
|
|
165
|
+
const path = e.composedPath();
|
|
166
|
+
if (!path.includes(this)) {
|
|
166
167
|
this.menuOpen = false;
|
|
167
168
|
this.chatOpen = false;
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (this.chatOpen) {
|
|
172
|
+
const root = this.renderRoot;
|
|
173
|
+
const panel = root.querySelector('.nile-ai-panel-overlay');
|
|
174
|
+
const trigger = root.querySelector('.nile-ai-trigger');
|
|
175
|
+
if (!path.some((n) => n === panel || n === trigger)) {
|
|
176
|
+
this.chatOpen = false;
|
|
177
|
+
}
|
|
168
178
|
}
|
|
169
179
|
};
|
|
170
180
|
this.handleChartReady = (e) => {
|
|
@@ -447,6 +457,7 @@ let NileChart = class NileChart extends NileElement {
|
|
|
447
457
|
aria-label="Ask AI about this chart"
|
|
448
458
|
aria-expanded=${this.chatOpen ? 'true' : 'false'}
|
|
449
459
|
@click=${this.toggleChat}
|
|
460
|
+
part="ai-trigger"
|
|
450
461
|
>
|
|
451
462
|
<nile-glyph name="smart-code" size="16"></nile-glyph>
|
|
452
463
|
</button>
|
|
@@ -516,7 +527,14 @@ let NileChart = class NileChart extends NileElement {
|
|
|
516
527
|
const config = this.activeConfig;
|
|
517
528
|
// Suppress inner Highcharts title/subtitle — the card header shows them
|
|
518
529
|
const noTitle = { title: { text: undefined }, subtitle: { text: undefined } };
|
|
519
|
-
|
|
530
|
+
// Translate config.legend → Highcharts legend options and merge early so every
|
|
531
|
+
// chart type receives the full legend config (layout, align, navigation, etc.) via .options.
|
|
532
|
+
const legendOptions = {};
|
|
533
|
+
if (config.legend) {
|
|
534
|
+
const { show, ...rest } = config.legend;
|
|
535
|
+
legendOptions.legend = { enabled: show ?? true, ...rest };
|
|
536
|
+
}
|
|
537
|
+
const mergedOptions = deepMerge(deepMerge(deepMerge(config.options ?? {}, legendOptions), noTitle), this.buildExportingOptions());
|
|
520
538
|
switch (config.type) {
|
|
521
539
|
case 'bar':
|
|
522
540
|
return html `<nile-bar-chart
|
|
@@ -524,7 +542,7 @@ let NileChart = class NileChart extends NileElement {
|
|
|
524
542
|
.categories=${config.categories ?? []}
|
|
525
543
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
526
544
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
527
|
-
.
|
|
545
|
+
.legend=${config.legend ?? null}
|
|
528
546
|
.options=${mergedOptions}
|
|
529
547
|
.loading=${config.loading ?? false}
|
|
530
548
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -545,7 +563,7 @@ let NileChart = class NileChart extends NileElement {
|
|
|
545
563
|
.seriesName=${config.seriesName ?? ''}
|
|
546
564
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
547
565
|
.showDataLabels=${config.showDataLabels ?? true}
|
|
548
|
-
.
|
|
566
|
+
.legend=${config.legend ?? null}
|
|
549
567
|
.options=${mergedOptions}
|
|
550
568
|
.loading=${config.loading ?? false}
|
|
551
569
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -567,6 +585,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
567
585
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
568
586
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
569
587
|
.forecast=${config.forecast ?? null}
|
|
588
|
+
.showLegend=${config.legend?.show ?? true}
|
|
589
|
+
.legend=${config.legend ?? null}
|
|
570
590
|
.options=${mergedOptions}
|
|
571
591
|
.loading=${config.loading ?? false}
|
|
572
592
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -588,6 +608,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
588
608
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
589
609
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
590
610
|
.anomaly=${config.anomaly ?? {}}
|
|
611
|
+
.showLegend=${config.legend?.show ?? true}
|
|
612
|
+
.legend=${config.legend ?? null}
|
|
591
613
|
.options=${mergedOptions}
|
|
592
614
|
.loading=${config.loading ?? false}
|
|
593
615
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -608,7 +630,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
608
630
|
.categories=${config.categories ?? []}
|
|
609
631
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
610
632
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
611
|
-
.showLegend=${config.
|
|
633
|
+
.showLegend=${config.legend?.show ?? true}
|
|
634
|
+
.legend=${config.legend ?? null}
|
|
612
635
|
.options=${mergedOptions}
|
|
613
636
|
.loading=${config.loading ?? false}
|
|
614
637
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -630,7 +653,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
630
653
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
631
654
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
632
655
|
.stacked=${config.stacked ?? false}
|
|
633
|
-
.showLegend=${config.
|
|
656
|
+
.showLegend=${config.legend?.show ?? true}
|
|
657
|
+
.legend=${config.legend ?? null}
|
|
634
658
|
.options=${mergedOptions}
|
|
635
659
|
.loading=${config.loading ?? false}
|
|
636
660
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -651,7 +675,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
651
675
|
.categories=${config.categories ?? []}
|
|
652
676
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
653
677
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
654
|
-
.showLegend=${config.
|
|
678
|
+
.showLegend=${config.legend?.show ?? true}
|
|
679
|
+
.legend=${config.legend ?? null}
|
|
655
680
|
.options=${mergedOptions}
|
|
656
681
|
.loading=${config.loading ?? false}
|
|
657
682
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -674,7 +699,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
674
699
|
.innerSize=${config.innerSize ?? '50%'}
|
|
675
700
|
.semiCircle=${config.semiCircle ?? false}
|
|
676
701
|
.showDataLabels=${config.showDataLabels ?? true}
|
|
677
|
-
.showLegend=${config.
|
|
702
|
+
.showLegend=${config.legend?.show ?? true}
|
|
703
|
+
.legend=${config.legend ?? null}
|
|
678
704
|
.options=${mergedOptions}
|
|
679
705
|
.loading=${config.loading ?? false}
|
|
680
706
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -695,7 +721,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
695
721
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
696
722
|
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
697
723
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
698
|
-
.showLegend=${config.
|
|
724
|
+
.showLegend=${config.legend?.show ?? true}
|
|
725
|
+
.legend=${config.legend ?? null}
|
|
699
726
|
.options=${mergedOptions}
|
|
700
727
|
.loading=${config.loading ?? false}
|
|
701
728
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -716,7 +743,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
716
743
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
717
744
|
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
718
745
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
719
|
-
.showLegend=${config.
|
|
746
|
+
.showLegend=${config.legend?.show ?? true}
|
|
747
|
+
.legend=${config.legend ?? null}
|
|
720
748
|
.options=${mergedOptions}
|
|
721
749
|
.loading=${config.loading ?? false}
|
|
722
750
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -737,7 +765,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
737
765
|
.categories=${config.categories ?? []}
|
|
738
766
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
739
767
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
740
|
-
.showLegend=${config.
|
|
768
|
+
.showLegend=${config.legend?.show ?? true}
|
|
769
|
+
.legend=${config.legend ?? null}
|
|
741
770
|
.options=${mergedOptions}
|
|
742
771
|
.loading=${config.loading ?? false}
|
|
743
772
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -758,7 +787,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
758
787
|
.categories=${config.categories ?? []}
|
|
759
788
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
760
789
|
.showArea=${config.showArea ?? false}
|
|
761
|
-
.showLegend=${config.
|
|
790
|
+
.showLegend=${config.legend?.show ?? true}
|
|
791
|
+
.legend=${config.legend ?? null}
|
|
762
792
|
.options=${mergedOptions}
|
|
763
793
|
.loading=${config.loading ?? false}
|
|
764
794
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -781,6 +811,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
781
811
|
.suffix=${config.suffix ?? ''}
|
|
782
812
|
.bands=${config.bands ?? []}
|
|
783
813
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
814
|
+
.showLegend=${config.legend?.show ?? false}
|
|
815
|
+
.legend=${config.legend ?? null}
|
|
784
816
|
.options=${mergedOptions}
|
|
785
817
|
.loading=${config.loading ?? false}
|
|
786
818
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -800,7 +832,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
800
832
|
.data=${config.data}
|
|
801
833
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
802
834
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
803
|
-
.showLegend=${config.
|
|
835
|
+
.showLegend=${config.legend?.show ?? true}
|
|
836
|
+
.legend=${config.legend ?? null}
|
|
804
837
|
.options=${mergedOptions}
|
|
805
838
|
.loading=${config.loading ?? false}
|
|
806
839
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -823,6 +856,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
823
856
|
.seriesType=${config.seriesType ?? 'map'}
|
|
824
857
|
.zoom=${config.zoom ?? true}
|
|
825
858
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
859
|
+
.showLegend=${config.legend?.show ?? true}
|
|
860
|
+
.legend=${config.legend ?? null}
|
|
826
861
|
.options=${mergedOptions}
|
|
827
862
|
.loading=${config.loading ?? false}
|
|
828
863
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -844,7 +879,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
844
879
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
845
880
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
846
881
|
.stackMode=${config.stackMode ?? 'normal'}
|
|
847
|
-
.showLegend=${config.
|
|
882
|
+
.showLegend=${config.legend?.show ?? true}
|
|
883
|
+
.legend=${config.legend ?? null}
|
|
848
884
|
.pointPadding=${config.pointPadding ?? 0.05}
|
|
849
885
|
.options=${mergedOptions}
|
|
850
886
|
.loading=${config.loading ?? false}
|
|
@@ -866,7 +902,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
866
902
|
.categories=${config.categories ?? []}
|
|
867
903
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
868
904
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
869
|
-
.showLegend=${config.
|
|
905
|
+
.showLegend=${config.legend?.show ?? true}
|
|
906
|
+
.legend=${config.legend ?? null}
|
|
870
907
|
.groupPadding=${config.groupPadding ?? 0.15}
|
|
871
908
|
.pointPadding=${config.pointPadding ?? 0.05}
|
|
872
909
|
.options=${mergedOptions}
|
|
@@ -894,7 +931,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
894
931
|
.histogramColor=${config.histogramColor ?? '#3b82f6'}
|
|
895
932
|
.binsNumber=${String(config.binsNumber ?? 'square-root')}
|
|
896
933
|
.binWidth=${config.binWidth ?? 0}
|
|
897
|
-
.showLegend=${config.
|
|
934
|
+
.showLegend=${config.legend?.show ?? true}
|
|
935
|
+
.legend=${config.legend ?? null}
|
|
898
936
|
.options=${mergedOptions}
|
|
899
937
|
.loading=${config.loading ?? false}
|
|
900
938
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -921,7 +959,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
921
959
|
.bellcurveFill=${config.bellcurveFill ?? 'rgba(99, 102, 241, 0.2)'}
|
|
922
960
|
.intervals=${config.intervals ?? 3}
|
|
923
961
|
.pointsInInterval=${config.pointsInInterval ?? 40}
|
|
924
|
-
.showLegend=${config.
|
|
962
|
+
.showLegend=${config.legend?.show ?? true}
|
|
963
|
+
.legend=${config.legend ?? null}
|
|
925
964
|
.options=${mergedOptions}
|
|
926
965
|
.loading=${config.loading ?? false}
|
|
927
966
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -944,7 +983,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
944
983
|
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
945
984
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
946
985
|
.horizontal=${config.horizontal ?? false}
|
|
947
|
-
.showLegend=${config.
|
|
986
|
+
.showLegend=${config.legend?.show ?? true}
|
|
987
|
+
.legend=${config.legend ?? null}
|
|
948
988
|
.options=${mergedOptions}
|
|
949
989
|
.loading=${config.loading ?? false}
|
|
950
990
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -967,7 +1007,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
967
1007
|
.datetimeAxis=${config.datetimeAxis ?? false}
|
|
968
1008
|
.inverted=${config.inverted ?? false}
|
|
969
1009
|
.alternateLabels=${config.alternateLabels ?? false}
|
|
970
|
-
.showLegend=${config.
|
|
1010
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1011
|
+
.legend=${config.legend ?? null}
|
|
971
1012
|
.options=${mergedOptions}
|
|
972
1013
|
.loading=${config.loading ?? false}
|
|
973
1014
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -991,7 +1032,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
991
1032
|
.lowMarkerColor=${config.lowMarkerColor ?? ''}
|
|
992
1033
|
.connectorColor=${config.connectorColor ?? ''}
|
|
993
1034
|
.horizontal=${config.horizontal ?? false}
|
|
994
|
-
.showLegend=${config.
|
|
1035
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1036
|
+
.legend=${config.legend ?? null}
|
|
995
1037
|
.options=${mergedOptions}
|
|
996
1038
|
.loading=${config.loading ?? false}
|
|
997
1039
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1015,7 +1057,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1015
1057
|
.lowMarkerColor=${config.lowMarkerColor ?? ''}
|
|
1016
1058
|
.connectorColor=${config.connectorColor ?? ''}
|
|
1017
1059
|
.horizontal=${config.horizontal ?? false}
|
|
1018
|
-
.showLegend=${config.
|
|
1060
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1061
|
+
.legend=${config.legend ?? null}
|
|
1019
1062
|
.options=${mergedOptions}
|
|
1020
1063
|
.loading=${config.loading ?? false}
|
|
1021
1064
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1039,7 +1082,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1039
1082
|
.lowMarkerColor=${config.lowMarkerColor ?? ''}
|
|
1040
1083
|
.connectorColor=${config.connectorColor ?? ''}
|
|
1041
1084
|
.horizontal=${config.horizontal ?? false}
|
|
1042
|
-
.showLegend=${config.
|
|
1085
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1086
|
+
.legend=${config.legend ?? null}
|
|
1043
1087
|
.options=${mergedOptions}
|
|
1044
1088
|
.loading=${config.loading ?? false}
|
|
1045
1089
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1064,7 +1108,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1064
1108
|
.lineColor=${config.lineColor ?? '#1d4ed8'}
|
|
1065
1109
|
.forecastStartIndex=${config.forecastStartIndex ?? -1}
|
|
1066
1110
|
.forecastBandLabel=${config.forecastBandLabel ?? ''}
|
|
1067
|
-
.showLegend=${config.
|
|
1111
|
+
.showLegend=${config.legend?.show ?? false}
|
|
1112
|
+
.legend=${config.legend ?? null}
|
|
1068
1113
|
.options=${mergedOptions}
|
|
1069
1114
|
.loading=${config.loading ?? false}
|
|
1070
1115
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1085,6 +1130,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1085
1130
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1086
1131
|
.seriesName=${config.seriesName ?? ''}
|
|
1087
1132
|
.showDataLabels=${config.showDataLabels ?? true}
|
|
1133
|
+
.showLegend=${config.legend?.show ?? false}
|
|
1134
|
+
.legend=${config.legend ?? null}
|
|
1088
1135
|
.options=${mergedOptions}
|
|
1089
1136
|
.loading=${config.loading ?? false}
|
|
1090
1137
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1106,6 +1153,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1106
1153
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1107
1154
|
.seriesName=${config.seriesName ?? ''}
|
|
1108
1155
|
.inverted=${config.inverted ?? true}
|
|
1156
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1157
|
+
.legend=${config.legend ?? null}
|
|
1109
1158
|
.options=${mergedOptions}
|
|
1110
1159
|
.loading=${config.loading ?? false}
|
|
1111
1160
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1128,6 +1177,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1128
1177
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1129
1178
|
.columnAxisTitle=${config.columnAxisTitle ?? ''}
|
|
1130
1179
|
.lineAxisTitle=${config.lineAxisTitle ?? ''}
|
|
1180
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1181
|
+
.legend=${config.legend ?? null}
|
|
1131
1182
|
.options=${mergedOptions}
|
|
1132
1183
|
.loading=${config.loading ?? false}
|
|
1133
1184
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1155,7 +1206,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1155
1206
|
.maxColor=${config.maxColor ?? '#1e40af'}
|
|
1156
1207
|
.colorAxisTitle=${config.colorAxisTitle ?? ''}
|
|
1157
1208
|
.showDataLabels=${config.showDataLabels ?? true}
|
|
1158
|
-
.showLegend=${config.
|
|
1209
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1210
|
+
.legend=${config.legend ?? null}
|
|
1159
1211
|
.options=${mergedOptions}
|
|
1160
1212
|
.loading=${config.loading ?? false}
|
|
1161
1213
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1176,6 +1228,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1176
1228
|
.data=${config.data ?? []}
|
|
1177
1229
|
.sunburstData=${config.sunburstData ?? []}
|
|
1178
1230
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1231
|
+
.showLegend=${config.legend?.show ?? false}
|
|
1232
|
+
.legend=${config.legend ?? null}
|
|
1179
1233
|
.options=${mergedOptions}
|
|
1180
1234
|
.loading=${config.loading ?? false}
|
|
1181
1235
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1196,7 +1250,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1196
1250
|
.categories=${config.categories ?? []}
|
|
1197
1251
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1198
1252
|
.showArea=${config.showArea ?? false}
|
|
1199
|
-
.showLegend=${config.
|
|
1253
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1254
|
+
.legend=${config.legend ?? null}
|
|
1200
1255
|
.options=${mergedOptions}
|
|
1201
1256
|
.loading=${config.loading ?? false}
|
|
1202
1257
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1218,6 +1273,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1218
1273
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1219
1274
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1220
1275
|
.stacked=${config.stacked ?? false}
|
|
1276
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1277
|
+
.legend=${config.legend ?? null}
|
|
1221
1278
|
.options=${mergedOptions}
|
|
1222
1279
|
.loading=${config.loading ?? false}
|
|
1223
1280
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1237,6 +1294,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1237
1294
|
.data=${config.data}
|
|
1238
1295
|
.categories=${config.categories ?? []}
|
|
1239
1296
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1297
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1298
|
+
.legend=${config.legend ?? null}
|
|
1240
1299
|
.options=${mergedOptions}
|
|
1241
1300
|
.loading=${config.loading ?? false}
|
|
1242
1301
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1256,6 +1315,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1256
1315
|
.data=${config.data}
|
|
1257
1316
|
.categories=${config.categories ?? []}
|
|
1258
1317
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1318
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1319
|
+
.legend=${config.legend ?? null}
|
|
1259
1320
|
.options=${mergedOptions}
|
|
1260
1321
|
.loading=${config.loading ?? false}
|
|
1261
1322
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1277,6 +1338,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1277
1338
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1278
1339
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1279
1340
|
.stacked=${config.stacked ?? false}
|
|
1341
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1342
|
+
.legend=${config.legend ?? null}
|
|
1280
1343
|
.options=${mergedOptions}
|
|
1281
1344
|
.loading=${config.loading ?? false}
|
|
1282
1345
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1298,6 +1361,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1298
1361
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1299
1362
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1300
1363
|
.threshold=${config.threshold ?? 0}
|
|
1364
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1365
|
+
.legend=${config.legend ?? null}
|
|
1301
1366
|
.options=${mergedOptions}
|
|
1302
1367
|
.loading=${config.loading ?? false}
|
|
1303
1368
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1318,6 +1383,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1318
1383
|
.categories=${config.categories ?? []}
|
|
1319
1384
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1320
1385
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1386
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1387
|
+
.legend=${config.legend ?? null}
|
|
1321
1388
|
.options=${mergedOptions}
|
|
1322
1389
|
.loading=${config.loading ?? false}
|
|
1323
1390
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1338,6 +1405,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1338
1405
|
.categories=${config.categories ?? []}
|
|
1339
1406
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1340
1407
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1408
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1409
|
+
.legend=${config.legend ?? null}
|
|
1341
1410
|
.options=${mergedOptions}
|
|
1342
1411
|
.loading=${config.loading ?? false}
|
|
1343
1412
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1359,6 +1428,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1359
1428
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1360
1429
|
.seriesName=${config.seriesName ?? ''}
|
|
1361
1430
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1431
|
+
.showLegend=${config.legend?.show ?? false}
|
|
1432
|
+
.legend=${config.legend ?? null}
|
|
1362
1433
|
.options=${mergedOptions}
|
|
1363
1434
|
.loading=${config.loading ?? false}
|
|
1364
1435
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1381,7 +1452,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1381
1452
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1382
1453
|
.innerSize=${config.innerSize ?? '28%'}
|
|
1383
1454
|
.paneSize=${config.paneSize ?? '82%'}
|
|
1384
|
-
.showLegend=${config.
|
|
1455
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1456
|
+
.legend=${config.legend ?? null}
|
|
1385
1457
|
.options=${mergedOptions}
|
|
1386
1458
|
.loading=${config.loading ?? false}
|
|
1387
1459
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1402,7 +1474,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1402
1474
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1403
1475
|
.seriesName=${config.seriesName ?? ''}
|
|
1404
1476
|
.showDataLabels=${config.showDataLabels ?? true}
|
|
1405
|
-
.showLegend=${config.
|
|
1477
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1478
|
+
.legend=${config.legend ?? null}
|
|
1406
1479
|
.options=${mergedOptions}
|
|
1407
1480
|
.loading=${config.loading ?? false}
|
|
1408
1481
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1421,6 +1494,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1421
1494
|
return html `<nile-euler-chart
|
|
1422
1495
|
.data=${config.data}
|
|
1423
1496
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1497
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1498
|
+
.legend=${config.legend ?? null}
|
|
1424
1499
|
.options=${mergedOptions}
|
|
1425
1500
|
.loading=${config.loading ?? false}
|
|
1426
1501
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1441,6 +1516,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1441
1516
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1442
1517
|
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
1443
1518
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1519
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1520
|
+
.legend=${config.legend ?? null}
|
|
1444
1521
|
.options=${mergedOptions}
|
|
1445
1522
|
.loading=${config.loading ?? false}
|
|
1446
1523
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1462,6 +1539,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1462
1539
|
.seriesName=${config.seriesName ?? ''}
|
|
1463
1540
|
.xAxisTitle=${config.xAxisTitle ?? ''}
|
|
1464
1541
|
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
1542
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1543
|
+
.legend=${config.legend ?? null}
|
|
1465
1544
|
.options=${mergedOptions}
|
|
1466
1545
|
.loading=${config.loading ?? false}
|
|
1467
1546
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1483,7 +1562,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1483
1562
|
.height=${this.hasAttribute('fit') ? null : (config.height ?? '100%')}
|
|
1484
1563
|
.seriesName=${config.seriesName ?? ''}
|
|
1485
1564
|
.datetimeAxis=${config.datetimeAxis ?? false}
|
|
1486
|
-
.showLegend=${config.
|
|
1565
|
+
.showLegend=${config.legend?.show ?? true}
|
|
1566
|
+
.legend=${config.legend ?? null}
|
|
1487
1567
|
.options=${mergedOptions}
|
|
1488
1568
|
.loading=${config.loading ?? false}
|
|
1489
1569
|
.chartBg=${config.chartBg ?? ''}
|
|
@@ -1565,6 +1645,8 @@ let NileChart = class NileChart extends NileElement {
|
|
|
1565
1645
|
valueFormat: k.valueFormat,
|
|
1566
1646
|
precision: k.precision,
|
|
1567
1647
|
unit: k.unit,
|
|
1648
|
+
locale: k.locale,
|
|
1649
|
+
numberSystem: k.numberSystem,
|
|
1568
1650
|
},
|
|
1569
1651
|
aq: {
|
|
1570
1652
|
chartSubtitle: k.chartSubtitle,
|
|
@@ -25,6 +25,8 @@ export declare class NileClusterChart extends NileElement {
|
|
|
25
25
|
height: string;
|
|
26
26
|
yAxisTitle: string;
|
|
27
27
|
showLegend: boolean;
|
|
28
|
+
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
29
|
+
legend: import('../nile-pie-chart/nile-pie-chart.js').LegendConfig | null;
|
|
28
30
|
groupPadding: number;
|
|
29
31
|
pointPadding: number;
|
|
30
32
|
chartBg: string;
|
|
@@ -23,6 +23,8 @@ let NileClusterChart = class NileClusterChart extends NileElement {
|
|
|
23
23
|
this.height = '400px';
|
|
24
24
|
this.yAxisTitle = '';
|
|
25
25
|
this.showLegend = true;
|
|
26
|
+
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
27
|
+
this.legend = null;
|
|
26
28
|
this.groupPadding = 0.14;
|
|
27
29
|
this.pointPadding = 0.08;
|
|
28
30
|
// ── Container styling ──
|
|
@@ -131,7 +133,7 @@ let NileClusterChart = class NileClusterChart extends NileElement {
|
|
|
131
133
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
132
134
|
xAxis: { categories: this.categories },
|
|
133
135
|
yAxis: { min: 0, title: { text: this.yAxisTitle || undefined } },
|
|
134
|
-
legend: { enabled: this.showLegend },
|
|
136
|
+
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
135
137
|
tooltip: { shared: true },
|
|
136
138
|
plotOptions: {
|
|
137
139
|
column: {
|
|
@@ -222,6 +224,9 @@ __decorate([
|
|
|
222
224
|
__decorate([
|
|
223
225
|
property({ type: Boolean, attribute: 'show-legend' })
|
|
224
226
|
], NileClusterChart.prototype, "showLegend", void 0);
|
|
227
|
+
__decorate([
|
|
228
|
+
property({ type: Object })
|
|
229
|
+
], NileClusterChart.prototype, "legend", void 0);
|
|
225
230
|
__decorate([
|
|
226
231
|
property({ type: Number, attribute: 'group-padding' })
|
|
227
232
|
], NileClusterChart.prototype, "groupPadding", void 0);
|
|
@@ -24,6 +24,8 @@ export declare class NileColumnChart extends NileElement {
|
|
|
24
24
|
height: string;
|
|
25
25
|
yAxisTitle: string;
|
|
26
26
|
showLegend: boolean;
|
|
27
|
+
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
28
|
+
legend: import('../nile-pie-chart/nile-pie-chart.js').LegendConfig | null;
|
|
27
29
|
chartBg: string;
|
|
28
30
|
chartBorderRadius: string | number;
|
|
29
31
|
chartBorder: string;
|
|
@@ -22,6 +22,8 @@ let NileColumnChart = class NileColumnChart extends NileElement {
|
|
|
22
22
|
this.height = '400px';
|
|
23
23
|
this.yAxisTitle = '';
|
|
24
24
|
this.showLegend = true;
|
|
25
|
+
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
26
|
+
this.legend = null;
|
|
25
27
|
// ── Container styling ──
|
|
26
28
|
this.chartBg = '';
|
|
27
29
|
this.chartBorderRadius = '';
|
|
@@ -165,7 +167,7 @@ let NileColumnChart = class NileColumnChart extends NileElement {
|
|
|
165
167
|
series: { cursor: 'pointer', point: { events: { click() { self.emit('nile-chart-click', { point: this, category: this.category, value: this.y, seriesName: this.series.name }); } } } },
|
|
166
168
|
},
|
|
167
169
|
series: this.data.map(s => ({ type: 'column', name: s.name, data: s.data, color: s.color })),
|
|
168
|
-
legend: { enabled: this.showLegend },
|
|
170
|
+
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
169
171
|
credits: { enabled: false },
|
|
170
172
|
}, this.options);
|
|
171
173
|
}
|
|
@@ -221,6 +223,9 @@ __decorate([
|
|
|
221
223
|
__decorate([
|
|
222
224
|
property({ type: Boolean, attribute: 'show-legend' })
|
|
223
225
|
], NileColumnChart.prototype, "showLegend", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ type: Object })
|
|
228
|
+
], NileColumnChart.prototype, "legend", void 0);
|
|
224
229
|
__decorate([
|
|
225
230
|
property({ type: String, attribute: 'chart-bg' })
|
|
226
231
|
], NileColumnChart.prototype, "chartBg", void 0);
|
|
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
3
|
import NileElement from '../internal/nile-element.js';
|
|
4
4
|
import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
|
|
5
|
+
import type { LegendConfig } from '../nile-pie-chart/nile-pie-chart.js';
|
|
5
6
|
export interface ColumnDrilldownParentPoint {
|
|
6
7
|
name: string;
|
|
7
8
|
y: number;
|
|
@@ -42,6 +43,9 @@ export declare class NileColumnDrilldownChart extends NileElement {
|
|
|
42
43
|
loadingFontSize: string | number;
|
|
43
44
|
loadingFontFamily: string;
|
|
44
45
|
loadingBg: string;
|
|
46
|
+
showLegend: boolean;
|
|
47
|
+
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
48
|
+
legend: LegendConfig | null;
|
|
45
49
|
private _syncCssVars;
|
|
46
50
|
private applyConfig;
|
|
47
51
|
connectedCallback(): void;
|
|
@@ -35,6 +35,9 @@ let NileColumnDrilldownChart = class NileColumnDrilldownChart extends NileElemen
|
|
|
35
35
|
this.loadingFontSize = '';
|
|
36
36
|
this.loadingFontFamily = '';
|
|
37
37
|
this.loadingBg = '';
|
|
38
|
+
this.showLegend = false;
|
|
39
|
+
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
40
|
+
this.legend = null;
|
|
38
41
|
}
|
|
39
42
|
_syncCssVars() {
|
|
40
43
|
const set = (prop, val) => {
|
|
@@ -95,6 +98,8 @@ let NileColumnDrilldownChart = class NileColumnDrilldownChart extends NileElemen
|
|
|
95
98
|
'height',
|
|
96
99
|
'yAxisTitle',
|
|
97
100
|
'loading',
|
|
101
|
+
'showLegend',
|
|
102
|
+
'legend',
|
|
98
103
|
];
|
|
99
104
|
if (!props.some(p => changedProperties.has(p)))
|
|
100
105
|
return;
|
|
@@ -131,7 +136,7 @@ let NileColumnDrilldownChart = class NileColumnDrilldownChart extends NileElemen
|
|
|
131
136
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
132
137
|
xAxis: { type: 'category' },
|
|
133
138
|
yAxis: { title: { text: this.yAxisTitle || undefined }, allowDecimals: false },
|
|
134
|
-
legend: { enabled:
|
|
139
|
+
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
135
140
|
plotOptions: {
|
|
136
141
|
series: {
|
|
137
142
|
cursor: 'pointer',
|
|
@@ -251,6 +256,12 @@ __decorate([
|
|
|
251
256
|
__decorate([
|
|
252
257
|
property({ type: String, attribute: 'loading-bg' })
|
|
253
258
|
], NileColumnDrilldownChart.prototype, "loadingBg", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
property({ type: Boolean, attribute: 'show-legend' })
|
|
261
|
+
], NileColumnDrilldownChart.prototype, "showLegend", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
property({ type: Object })
|
|
264
|
+
], NileColumnDrilldownChart.prototype, "legend", void 0);
|
|
254
265
|
NileColumnDrilldownChart = __decorate([
|
|
255
266
|
customElement('nile-column-drilldown-chart')
|
|
256
267
|
], NileColumnDrilldownChart);
|
|
@@ -2,6 +2,7 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
|
2
2
|
import type Highcharts from 'highcharts';
|
|
3
3
|
import NileElement from '../internal/nile-element.js';
|
|
4
4
|
import type { SeparatedChartConfigInputType } from '../internal/types/separated-chart-config-input.type.js';
|
|
5
|
+
import type { LegendConfig } from '../nile-pie-chart/nile-pie-chart.js';
|
|
5
6
|
export interface ColumnPyramidSeriesData {
|
|
6
7
|
name: string;
|
|
7
8
|
data: number[];
|
|
@@ -32,6 +33,9 @@ export declare class NileColumnPyramidChart extends NileElement {
|
|
|
32
33
|
loadingFontSize: string | number;
|
|
33
34
|
loadingFontFamily: string;
|
|
34
35
|
loadingBg: string;
|
|
36
|
+
showLegend: boolean;
|
|
37
|
+
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
38
|
+
legend: LegendConfig | null;
|
|
35
39
|
private _syncCssVars;
|
|
36
40
|
private applyConfig;
|
|
37
41
|
connectedCallback(): void;
|
|
@@ -33,6 +33,9 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
|
|
|
33
33
|
this.loadingFontSize = '';
|
|
34
34
|
this.loadingFontFamily = '';
|
|
35
35
|
this.loadingBg = '';
|
|
36
|
+
this.showLegend = true;
|
|
37
|
+
/** Full legend configuration — all Highcharts legend options in one object. */
|
|
38
|
+
this.legend = null;
|
|
36
39
|
}
|
|
37
40
|
_syncCssVars() {
|
|
38
41
|
const set = (prop, val) => {
|
|
@@ -83,7 +86,9 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
|
|
|
83
86
|
'loadingText', 'loadingColor', 'loadingFontSize', 'loadingFontFamily', 'loadingBg'];
|
|
84
87
|
if (cssVarProps.some(p => changedProperties.has(p)))
|
|
85
88
|
this._syncCssVars();
|
|
86
|
-
const props = ['data', 'categories', 'chartTitle', 'chartSubtitle', 'options', 'height', 'loading'
|
|
89
|
+
const props = ['data', 'categories', 'chartTitle', 'chartSubtitle', 'options', 'height', 'loading',
|
|
90
|
+
'showLegend',
|
|
91
|
+
'legend'];
|
|
87
92
|
if (!props.some(p => changedProperties.has(p)))
|
|
88
93
|
return;
|
|
89
94
|
if (this.loading) {
|
|
@@ -135,6 +140,7 @@ let NileColumnPyramidChart = class NileColumnPyramidChart extends NileElement {
|
|
|
135
140
|
data: s.data,
|
|
136
141
|
color: s.color,
|
|
137
142
|
})),
|
|
143
|
+
legend: (() => { const { show, ...rest } = this.legend ?? {}; return { enabled: show ?? this.showLegend, ...rest }; })(),
|
|
138
144
|
credits: { enabled: false },
|
|
139
145
|
}, this.options);
|
|
140
146
|
}
|
|
@@ -220,6 +226,12 @@ __decorate([
|
|
|
220
226
|
__decorate([
|
|
221
227
|
property({ type: String, attribute: 'loading-bg' })
|
|
222
228
|
], NileColumnPyramidChart.prototype, "loadingBg", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ type: Boolean, attribute: 'show-legend' })
|
|
231
|
+
], NileColumnPyramidChart.prototype, "showLegend", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
property({ type: Object })
|
|
234
|
+
], NileColumnPyramidChart.prototype, "legend", void 0);
|
|
223
235
|
NileColumnPyramidChart = __decorate([
|
|
224
236
|
customElement('nile-column-pyramid-chart')
|
|
225
237
|
], NileColumnPyramidChart);
|