@sisense/sdk-ui-vue 2.34.0 → 2.36.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.
Files changed (43) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +76 -49
  3. package/dist/src/components/charts/area-chart.d.ts +12 -20
  4. package/dist/src/components/charts/area-range-chart.d.ts +39 -28
  5. package/dist/src/components/charts/areamap-chart.d.ts +23 -25
  6. package/dist/src/components/charts/bar-chart.d.ts +16 -25
  7. package/dist/src/components/charts/boxplot-chart.d.ts +22 -26
  8. package/dist/src/components/charts/calendar-heatmap-chart.d.ts +16 -22
  9. package/dist/src/components/charts/chart.d.ts +14 -43
  10. package/dist/src/components/charts/column-chart.d.ts +16 -25
  11. package/dist/src/components/charts/funnel-chart.d.ts +23 -26
  12. package/dist/src/components/charts/indicator-chart.d.ts +90 -20
  13. package/dist/src/components/charts/kpi-chart.d.ts +16 -18
  14. package/dist/src/components/charts/line-chart.d.ts +17 -25
  15. package/dist/src/components/charts/pie-chart.d.ts +20 -23
  16. package/dist/src/components/charts/pivot-table.d.ts +251 -18
  17. package/dist/src/components/charts/polar-chart.d.ts +16 -24
  18. package/dist/src/components/charts/sankey-chart.d.ts +13 -14
  19. package/dist/src/components/charts/scatter-chart.d.ts +23 -23
  20. package/dist/src/components/charts/scattermap-chart.d.ts +19 -23
  21. package/dist/src/components/charts/streamgraph-chart.d.ts +51 -17
  22. package/dist/src/components/charts/sunburst-chart.d.ts +15 -23
  23. package/dist/src/components/charts/table.d.ts +27 -24
  24. package/dist/src/components/charts/treemap-chart.d.ts +15 -23
  25. package/dist/src/components/dashboard/dashboard-model.d.ts +14 -0
  26. package/dist/src/components/dashboard/index.d.ts +1 -0
  27. package/dist/src/components/filters/criteria-filter-tile.d.ts +8 -0
  28. package/dist/src/components/filters/date-range-filter-tile.d.ts +8 -0
  29. package/dist/src/components/filters/filter-tile.d.ts +12 -1
  30. package/dist/src/components/filters/index.d.ts +2 -2
  31. package/dist/src/components/filters/member-filter-tile.d.ts +8 -0
  32. package/dist/src/components/widgets/chart-widget.d.ts +44 -46
  33. package/dist/src/components/widgets/index.d.ts +5 -2
  34. package/dist/src/components/widgets/widget-by-id.d.ts +20 -1
  35. package/dist/src/components/widgets/widget-config.d.ts +57 -0
  36. package/dist/src/components/widgets/widget-header-config.d.ts +6 -0
  37. package/dist/src/components/widgets/widget-model.d.ts +14 -0
  38. package/dist/src/components/widgets/widget.d.ts +46 -10
  39. package/dist/src/composables/use-get-widget-model.d.ts +2 -1
  40. package/dist/src/sdk-ui-core-exports.d.ts +1 -1
  41. package/dist/src/utilities/dashboard-model-translator.d.ts +1 -1
  42. package/dist/src/utilities/widget-model-translator.d.ts +5 -2
  43. package/package.json +3 -3
@@ -9,36 +9,34 @@ export interface AreamapChartProps extends AreamapChartPropsPreact {
9
9
  * A Vue component for visualizing geographical data as polygons on a map.
10
10
  *
11
11
  * @example
12
- * Here's how you can use the AreamapChart component in a Vue application:
13
12
  * ```vue
14
- * <template>
15
- <AreamapChart
16
- :dataOptions="areamapChartProps.dataOptions"
17
- :dataSet="areamapChartProps.dataSet"
18
- :filters="areamapChartProps.filters"
19
- />
20
- * </template>
21
- *
22
13
  * <script setup lang="ts">
23
14
  * import { ref } from 'vue';
24
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
25
- * import * as DM from '../assets/sample-retail-model';
26
- * import { AreamapChart, type AreamapChartProps } from '@sisense/sdk-ui-vue';
27
-
28
- * const dimProductName = DM.DimProducts.ProductName;
29
- * const measureTotalRevenue = measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue');
30
-
31
- const areamapChartProps = ref<AreamapChartProps>({
32
- dataSet: DM.DataSource,
33
- dataOptions: {
34
- geo: [DM.DimCountries.CountryName],
35
- color: [{ column: measureTotalRevenue, title: 'Total Revenue' }],
36
- },
37
- filters: [filterFactory.topRanking(dimProductName, measureTotalRevenue, 10)],
38
- });
15
+ * import { AreamapChart, type AreamapChartDataOptions, type AreamapStyleOptions } from '@sisense/sdk-ui-vue';
16
+ * import { measureFactory } from '@sisense/sdk-data';
17
+ * import * as DM from './sample-ecommerce';
18
+ *
19
+ * const chartProps = ref<{
20
+ * dataOptions: AreamapChartDataOptions;
21
+ * styleOptions: AreamapStyleOptions;
22
+ * }>({
23
+ * dataOptions: {
24
+ * geo: [DM.Country.Country],
25
+ * color: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
26
+ * },
27
+ * styleOptions: { mapType: 'world' },
28
+ * });
39
29
  * </script>
30
+ *
31
+ * <template>
32
+ * <AreamapChart
33
+ * :dataSet="DM.DataSource"
34
+ * :dataOptions="chartProps.dataOptions"
35
+ * :styleOptions="chartProps.styleOptions"
36
+ * />
37
+ * </template>
40
38
  * ```
41
- * <img src="media://vue-areamap-chart-example.png" width="600px" />
39
+ * <img src="media://areamap-chart-example-1.png" width="700px" />
42
40
  * @param props - Areamap chart properties
43
41
  * @returns Areamap Chart component
44
42
  * @group Charts
@@ -10,36 +10,27 @@ export interface BarChartProps extends BarChartPropsPreact {
10
10
  * whose lengths are proportional to the values that they represent.
11
11
  *
12
12
  * @example
13
- * Here's how you can use the BarChart component in a Vue application:
14
13
  * ```vue
15
- * <template>
16
- <BarChart
17
- :dataOptions="barChartProps.dataOptions"
18
- :dataSet="barChartProps.dataSet"
19
- :filters="barChartProps.filters"
20
- />
21
- * </template>
22
- *
23
14
  * <script setup lang="ts">
24
15
  * import { ref } from 'vue';
25
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
26
- * import * as DM from '../assets/sample-retail-model';
27
- * import { BarChart,type BarChartProps } from '@sisense/sdk-ui-vue';
28
-
29
- * const dimProductName = DM.DimProducts.ProductName;
30
- * const measureTotalRevenue = measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue');
31
- const barChartProps = ref<BarChartProps>({
32
- dataSet: DM.DataSource,
33
- dataOptions: {
34
- category: [dimProductName],
35
- value: [{ column: measureTotalRevenue, sortType: 'sortDesc' }],
36
- breakBy: [],
37
- },
38
- filters: [filterFactory.topRanking(dimProductName, measureTotalRevenue, 10)],
39
- });
16
+ * import { BarChart } from '@sisense/sdk-ui-vue';
17
+ * import { measureFactory } from '@sisense/sdk-data';
18
+ * import * as DM from './sample-ecommerce';
19
+ *
20
+ * const chartProps = ref({
21
+ * dataOptions: {
22
+ * category: [DM.Commerce.Date.Years],
23
+ * value: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
24
+ * breakBy: [DM.Commerce.Condition],
25
+ * },
26
+ * });
40
27
  * </script>
28
+ *
29
+ * <template>
30
+ * <BarChart :dataSet="DM.DataSource" :dataOptions="chartProps.dataOptions" />
31
+ * </template>
41
32
  * ```
42
- * <img src="media://vue-bar-chart-example.png" width="800"/>
33
+ * <img src="media://bar-chart-example-1.png" width="700px" />
43
34
  * @param props - Bar chart properties
44
35
  * @returns Bar Chart component
45
36
  * @group Charts
@@ -10,36 +10,32 @@ export interface BoxplotChartProps extends BoxplotChartPropsPreact {
10
10
  * and center of a data set along an axis.
11
11
  *
12
12
  * @example
13
- * Here's how you can use the BoxplotChart component in a Vue application:
14
13
  * ```vue
15
- * <template>
16
- <BoxplotChart
17
- :dataOptions="boxplotChartProps.dataOptions"
18
- :dataSet="boxplotChartProps.dataSet"
19
- :filters="boxplotChartProps.filters"
20
- />
21
- * </template>
22
- *
23
14
  * <script setup lang="ts">
24
15
  * import { ref } from 'vue';
25
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
26
- * import * as DM from '../assets/sample-retail-model';
27
- * import { BoxplotChart, type BoxplotChartProps } from '@sisense/sdk-ui-vue';
28
-
29
- * const dimProductName = DM.DimProducts.ProductName;
30
- * const measureTotalRevenue = measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue');
31
- * const boxplotChartProps = ref<BoxplotChartProps>({
32
- dataSet: DM.DataSource,
33
- dataOptions: {
34
- category: [dimProductName],
35
- value: [DM.Fact_Sale_orders.OrderRevenue],
36
- boxType: 'iqr',
37
- outliersEnabled: true,
38
- },
39
- filters: [filterFactory.topRanking(dimProductName, measureTotalRevenue, 10)],
40
- });
16
+ * import { BoxplotChart, type BoxplotChartDataOptions } from '@sisense/sdk-ui-vue';
17
+ * import * as DM from './sample-ecommerce';
18
+ *
19
+ * const chartProps = ref({
20
+ * dataOptions: {
21
+ * category: [DM.Commerce.Condition],
22
+ * value: [{ column: DM.Commerce.Cost, name: 'Total Cost' }],
23
+ * boxType: 'iqr',
24
+ * outliersEnabled: true,
25
+ * } as BoxplotChartDataOptions,
26
+ * styleOptions: { subtype: 'boxplot/full' },
27
+ * });
28
+ * </script>
29
+ *
30
+ * <template>
31
+ * <BoxplotChart
32
+ * :dataSet="DM.DataSource"
33
+ * :dataOptions="chartProps.dataOptions"
34
+ * :styleOptions="chartProps.styleOptions"
35
+ * />
36
+ * </template>
41
37
  * ```
42
- * <img src="media://vue-boxplot-chart-example.png" width="600px" />
38
+ * <img src="media://boxplot-chart-example-1.png" width="700px" />
43
39
  * @param props - Boxplot chart properties
44
40
  * @returns Boxplot Chart component
45
41
  * @group Charts
@@ -10,37 +10,31 @@ export interface CalendarHeatmapChartProps extends CalendarHeatmapChartPropsPrea
10
10
  * making it easy to identify daily patterns or anomalies
11
11
  *
12
12
  * @example
13
- * Here's how you can use the CalendarHeatmapChart component in a Vue application:
14
13
  * ```vue
15
- * <template>
16
- * <CalendarHeatmapChart
17
- :dataOptions="calendarChartProps.dataOptions"
18
- :dataSet="calendarChartProps.dataSet"
19
- :filters="calendarChartProps.filters"
20
- :styleOptions="calendarChartProps.styleOptions"
21
- />
22
- * </template>
23
- *
24
14
  * <script setup lang="ts">
25
15
  * import { ref } from 'vue';
26
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
27
- * import * as DM from '../assets/sample-retail-model';
28
- * import { CalendarHeatmapChart, type CalendarHeatmapChartProps } from '@sisense/sdk-ui-vue';
16
+ * import { CalendarHeatmapChart } from '@sisense/sdk-ui-vue';
17
+ * import { measureFactory } from '@sisense/sdk-data';
18
+ * import * as DM from './sample-ecommerce';
29
19
  *
30
- * const calendarChartProps = ref<CalendarHeatmapChartProps>({
31
- * dataSet: DM.DataSource,
20
+ * const chartProps = ref({
32
21
  * dataOptions: {
33
- * date: DM.DimDate.Date.Days,
34
- * value: measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue'),
35
- * },
36
- * styleOptions: {
37
- * viewType: 'quarter',
22
+ * date: DM.Commerce.Date.Days,
23
+ * value: { column: measureFactory.sum(DM.Commerce.Quantity, 'Total Quantity') },
38
24
  * },
39
- * filters: [],
25
+ * styleOptions: { viewType: 'quarter' as const },
40
26
  * });
41
27
  * </script>
28
+ *
29
+ * <template>
30
+ * <CalendarHeatmapChart
31
+ * :dataSet="DM.DataSource"
32
+ * :dataOptions="chartProps.dataOptions"
33
+ * :styleOptions="chartProps.styleOptions"
34
+ * />
35
+ * </template>
42
36
  * ```
43
- * <img src="media://vue-calendar-heatmap-chart-example.png" width="800"/>
37
+ * <img src="media://calendar-heatmap-chart-example-1.png" width="700px" />
44
38
  * @param {CalendarHeatmapChartProps} - Calendar heatmap chart properties
45
39
  * @returns Calendar Heatmap Chart component
46
40
  * @group Charts
@@ -5,57 +5,28 @@ export { ChartProps };
5
5
  * A Vue component used for easily switching chart types or rendering multiple series of different chart types.
6
6
  *
7
7
  * @example
8
- * An example of using the `Chart` component to
9
- * plot a bar chart of the Sample Retail data source hosted in a Sisense instance:
10
- * ```tsx
8
+ * ```vue
11
9
  * <script setup lang="ts">
12
- * import { Chart } from '@sisense/sdk-ui-vue';
13
- * import type { ChartProps } from '@sisense/sdk-ui-vue';
14
- * import * as DM from '../assets/sample-retail-model';
15
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
16
10
  * import { ref } from 'vue';
11
+ * import { Chart, ChartDataOptions, ChartType } from '@sisense/sdk-ui-vue';
12
+ * import { measureFactory } from '@sisense/sdk-data';
13
+ * import * as DM from './sample-ecommerce';
17
14
  *
18
- * const dimProductName = DM.DimProducts.ProductName;
19
- * const measureTotalRevenue = measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue');
20
- *
21
- const chartProps = ref<ChartProps>({
22
- chartType: 'bar',
23
- dataSet: DM.DataSource,
24
- dataOptions: {
25
- category: [dimProductName],
26
- value: [{ column: measureTotalRevenue, sortType: 'sortDesc' }],
27
- breakBy: [],
28
- },
29
- filters: [filterFactory.topRanking(dimProductName, measureTotalRevenue, 10)],
30
- styleOptions: {
31
- xAxis: {
32
- title: {
33
- text: 'Product Name',
34
- enabled: true,
35
- },
36
- },
37
- yAxis: {
38
- title: {
39
- text: 'Total Revenue',
40
- enabled: true,
41
- },
42
- },
43
- },
44
- });
15
+ * const chartProps = ref({
16
+ * chartType: 'column' as ChartType,
17
+ * dataOptions: {
18
+ * category: [DM.Commerce.Date.Quarters],
19
+ * value: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
20
+ * breakBy: [],
21
+ * } as ChartDataOptions,
22
+ * });
45
23
  * </script>
46
24
  *
47
25
  * <template>
48
- <Chart
49
- :chartType="chartProps.chartType"
50
- :dataSet="chartProps.dataSet"
51
- :dataOptions="chartProps.dataOptions"
52
- :filters="chartProps.filters"
53
- :styleOptions="chartProps.styleOptions"
54
- />
26
+ * <Chart :chartType="chartProps.chartType" :dataSet="DM.DataSource" :dataOptions="chartProps.dataOptions" />
55
27
  * </template>
56
28
  * ```
57
- *
58
- * <img src="media://vue-chart-example.png" width="800px" />
29
+ * <img src="media://chart-example-1.png" width="700px" />
59
30
  * @shortDescription Common component for rendering charts of different types including table
60
31
  * @param props - Chart properties
61
32
  * @returns Chart component representing a chart type as specified in `ChartProps.`{@link ChartProps.chartType | chartType}
@@ -10,36 +10,27 @@ export interface ColumnChartProps extends ColumnChartPropsPreact {
10
10
  * whose heights are proportional to the values that they represent.
11
11
  *
12
12
  * @example
13
- * Here's how you can use the ColumnChart component in a Vue application:
14
13
  * ```vue
15
- * <template>
16
- <ColumnChart
17
- :dataOptions="columnChartProps.dataOptions"
18
- :dataSet="columnChartProps.dataSet"
19
- :filters="columnChartProps.filters"
20
- />
21
- * </template>
22
- *
23
14
  * <script setup lang="ts">
24
15
  * import { ref } from 'vue';
25
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
26
- * import * as DM from '../assets/sample-retail-model';
27
- * import { ColumnChart, type ColumnChartProps } from '@sisense/sdk-ui-vue';
16
+ * import { ColumnChart } from '@sisense/sdk-ui-vue';
17
+ * import { measureFactory } from '@sisense/sdk-data';
18
+ * import * as DM from './sample-ecommerce';
28
19
  *
29
- * const dimProductName = DM.DimProducts.ProductName;
30
- * const measureTotalRevenue = measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue');
31
-
32
- const columnChartProps = ref<ColumnChartProps>({
33
- dataSet: DM.DataSource,
34
- dataOptions: {
35
- category: [dimProductName],
36
- value: [{ column: measureTotalRevenue, sortType: 'sortDesc' }],
37
- breakBy: [],
38
- },
39
- filters: [filterFactory.topRanking(dimProductName, measureTotalRevenue, 10)],
40
- });
20
+ * const chartProps = ref({
21
+ * dataOptions: {
22
+ * category: [DM.Commerce.Date.Years],
23
+ * value: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
24
+ * breakBy: [DM.Commerce.Condition],
25
+ * },
26
+ * });
27
+ * </script>
28
+ *
29
+ * <template>
30
+ * <ColumnChart :dataSet="DM.DataSource" :dataOptions="chartProps.dataOptions" />
31
+ * </template>
41
32
  * ```
42
- * <img src="media://vue-column-chart-example.png" width="800"/>
33
+ * <img src="media://column-chart-example-1.png" width="700px" />
43
34
  * @param props - Column chart properties
44
35
  * @returns Column Chart component
45
36
  * @group Charts
@@ -10,38 +10,35 @@ export interface FunnelChartProps extends FunnelChartPropsPreact {
10
10
  * It maintains compatibility with Vue's reactivity system while preserving the functionality of the FunnelChart.
11
11
  *
12
12
  * @example
13
- * Here's how you can use the FunnelChart component in a Vue application:
14
13
  * ```vue
15
- * <template>
16
- <FunnelChart
17
- :dataOptions="funnelChartProps.dataOptions"
18
- :dataSet="funnelChartProps.dataSet"
19
- :filters="funnelChartProps.filters"
20
- />
21
- * </template>
22
- *
23
14
  * <script setup lang="ts">
24
15
  * import { ref } from 'vue';
25
- * import { FunnelChart, type FunnelChartProps } from '@sisense/sdk-ui-vue';
26
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
27
- * import * as DM from '../assets/sample-retail-model';
28
- *
29
- * const dimProductName = DM.DimProducts.ProductName;
30
- * const measureTotalRevenue = measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue');
16
+ * import { FunnelChart, FunnelStyleOptions } from '@sisense/sdk-ui-vue';
17
+ * import { measureFactory } from '@sisense/sdk-data';
18
+ * import * as DM from './sample-ecommerce';
31
19
  *
32
- * const funnelChartProps = ref<FunnelChartProps>({
33
- dataSet: DM.DataSource,
34
- dataOptions: {
35
- category: [dimProductName],
36
- value: [{ column: measureTotalRevenue, sortType: 'sortDesc' }],
37
- },
38
- filters: [filterFactory.topRanking(dimProductName, measureTotalRevenue, 10)],
39
- });
20
+ * const chartProps = ref({
21
+ * dataOptions: {
22
+ * category: [DM.Commerce.AgeRange],
23
+ * value: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
24
+ * },
25
+ * styleOptions: {
26
+ * funnelType: 'regular',
27
+ * funnelSize: 'regular',
28
+ * funnelDirection: 'regular',
29
+ * } as FunnelStyleOptions,
30
+ * });
40
31
  * </script>
41
- * ```
42
- * <img src="media://vue-funnel-chart-example.png" width="800"/>
43
32
  *
44
- * Note that the chart sorts the measure, `Unique Users`, in descending order by default.
33
+ * <template>
34
+ * <FunnelChart
35
+ * :dataSet="DM.DataSource"
36
+ * :dataOptions="chartProps.dataOptions"
37
+ * :styleOptions="chartProps.styleOptions"
38
+ * />
39
+ * </template>
40
+ * ```
41
+ * <img src="media://funnel-chart-example-1.png" width="700px" />
45
42
  * @param props - Funnel chart properties
46
43
  * @returns Funnel Chart component
47
44
  * @group Charts
@@ -9,34 +9,104 @@ export interface IndicatorChartProps extends IndicatorChartPropsPreact {
9
9
  * A Vue component that provides various options for displaying one or two numeric values as a number, gauge or ticker.
10
10
  *
11
11
  * @example
12
- * Here's how you can use the IndicatorChart component in a Vue application:
13
12
  * ```vue
13
+ * <script setup lang="ts">
14
+ * import { ref } from 'vue';
15
+ * import { IndicatorChart, IndicatorStyleOptions } from '@sisense/sdk-ui-vue';
16
+ * import { measureFactory } from '@sisense/sdk-data';
17
+ * import * as DM from './sample-ecommerce';
18
+ *
19
+ * const chartProps = ref({
20
+ * dataOptions: {
21
+ * value: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
22
+ * max: [measureFactory.constant(125000000)],
23
+ * },
24
+ * styleOptions: {
25
+ * indicatorComponents: {
26
+ * title: { shouldBeShown: true, text: 'Total Revenue' },
27
+ * ticks: { shouldBeShown: false },
28
+ * labels: { shouldBeShown: true },
29
+ * },
30
+ * subtype: 'indicator/gauge',
31
+ * skin: 2,
32
+ * } as IndicatorStyleOptions,
33
+ * });
34
+ * </script>
35
+ *
14
36
  * <template>
15
- <IndicatorChart
16
- :dataOptions="indicatorChartProps.dataOptions"
17
- :dataSet="indicatorChartProps.dataSet"
18
- :filters="indicatorChartProps.filters"
19
- />
37
+ * <IndicatorChart
38
+ * :dataSet="DM.DataSource"
39
+ * :dataOptions="chartProps.dataOptions"
40
+ * :styleOptions="chartProps.styleOptions"
41
+ * />
20
42
  * </template>
43
+ * ```
44
+ * <img src="media://indicator-chart-example-1.png" width="400px" />
45
+ *
46
+ * Numeric indicator variant with a secondary value:
21
47
  *
48
+ * ```vue
22
49
  * <script setup lang="ts">
23
50
  * import { ref } from 'vue';
24
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
25
- * import * as DM from '../assets/sample-retail-model';
26
- * import { IndicatorChart, type IndicatorChartProps } from '@sisense/sdk-ui-vue';
27
-
28
- * const dimProductName = DM.DimProducts.ProductName;
29
- * const measureTotalRevenue = measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue');
30
- const indicatorChartProps = ref<IndicatorChartProps>({
31
- dataSet: DM.DataSource,
32
- dataOptions: {
33
- value: [{ column: measureTotalRevenue, sortType: 'sortDesc' }],
34
- },
35
- filters: [filterFactory.topRanking(dimProductName, measureTotalRevenue, 10)],
36
- });
51
+ * import { IndicatorChart } from '@sisense/sdk-ui-vue';
52
+ * import { measureFactory } from '@sisense/sdk-data';
53
+ * import * as DM from './sample-ecommerce';
54
+ *
55
+ * const chartProps = ref({
56
+ * dataOptions: {
57
+ * value: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
58
+ * // secondary value is optional
59
+ * secondary: [measureFactory.sum(DM.Commerce.Quantity, 'Total Quantity')],
60
+ * },
61
+ * });
62
+ * </script>
63
+ *
64
+ * <template>
65
+ * <IndicatorChart :dataSet="DM.DataSource" :dataOptions="chartProps.dataOptions" />
66
+ * </template>
67
+ * ```
68
+ *
69
+ * <img src="media://indicator-chart-example-3.png" width="400px" />
70
+ *
71
+ * Ticker style indicator variant:
72
+ *
73
+ * ```vue
74
+ * <script setup lang="ts">
75
+ * import { ref } from 'vue';
76
+ * import { IndicatorChart, IndicatorStyleOptions } from '@sisense/sdk-ui-vue';
77
+ * import { measureFactory } from '@sisense/sdk-data';
78
+ * import * as DM from './sample-ecommerce';
79
+ *
80
+ * const chartProps = ref({
81
+ * dataOptions: {
82
+ * value: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
83
+ * max: [measureFactory.constant(125000000)],
84
+ * },
85
+ * styleOptions: {
86
+ * indicatorComponents: {
87
+ * title: { shouldBeShown: true, text: 'Total Revenue' },
88
+ * ticks: { shouldBeShown: false },
89
+ * labels: { shouldBeShown: true },
90
+ * },
91
+ * subtype: 'indicator/gauge',
92
+ * skin: 2,
93
+ * forceTickerView: true,
94
+ * tickerBarHeight: 30,
95
+ * width: 400,
96
+ * } as IndicatorStyleOptions,
97
+ * });
37
98
  * </script>
99
+ *
100
+ * <template>
101
+ * <IndicatorChart
102
+ * :dataSet="DM.DataSource"
103
+ * :dataOptions="chartProps.dataOptions"
104
+ * :styleOptions="chartProps.styleOptions"
105
+ * />
106
+ * </template>
38
107
  * ```
39
- * <img src="media://vue-indicator-chart-example.png" width="400px" />
108
+ *
109
+ * <img src="media://indicator-chart-example-4.png" width="400px" />
40
110
  * @param props - Indicator chart properties
41
111
  * @returns Indicator Chart component
42
112
  * @group Charts
@@ -15,37 +15,35 @@ export interface KpiChartProps extends KpiChartPropsPreact {
15
15
  * a second measure, or against a target.
16
16
  *
17
17
  * @example
18
- * Here's how you can use the KpiChart component in a Vue application:
19
18
  * ```vue
20
- * <template>
21
- * <KpiChart
22
- :dataSet="kpiChartProps.dataSet"
23
- :dataOptions="kpiChartProps.dataOptions"
24
- :filters="kpiChartProps.filters"
25
- :styleOptions="kpiChartProps.styleOptions"
26
- />
27
- * </template>
28
- *
29
19
  * <script setup lang="ts">
30
20
  * import { ref } from 'vue';
21
+ * import { KpiChart } from '@sisense/sdk-ui-vue';
22
+ * import * as DM from './sample-ecommerce';
31
23
  * import { measureFactory } from '@sisense/sdk-data';
32
- * import * as DM from '../assets/sample-retail-model';
33
- * import { KpiChart, type KpiChartProps } from '@sisense/sdk-ui-vue';
34
24
  *
35
- * const kpiChartProps = ref<KpiChartProps>({
36
- * dataSet: DM.DataSource,
25
+ * const chartProps = ref({
37
26
  * dataOptions: {
38
- * value: measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue'),
39
- * category: DM.DimDate.Date.Months,
27
+ * value: measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue'),
28
+ * category: DM.Commerce.Date.Months,
40
29
  * comparison: { type: 'previous-period' },
41
30
  * },
42
31
  * styleOptions: {
43
- * title: { text: 'Total Revenue' },
32
+ * sparkline: { chartType: 'area' },
33
+ * height: 250,
44
34
  * },
45
- * filters: [],
46
35
  * });
47
36
  * </script>
37
+ *
38
+ * <template>
39
+ * <KpiChart
40
+ * :dataSet="DM.DataSource"
41
+ * :dataOptions="chartProps.dataOptions"
42
+ * :styleOptions="chartProps.styleOptions"
43
+ * />
44
+ * </template>
48
45
  * ```
46
+ * <img src="media://kpi-chart-example-1.png" width="400px" />
49
47
  * @param {KpiChartProps} - KPI chart properties
50
48
  * @returns KPI Chart component
51
49
  * @group Charts
@@ -10,35 +10,27 @@ export interface LineChartProps extends LineChartPropsPreact {
10
10
  * It maintains compatibility with Vue's reactivity system while preserving the functionality of the LineChart.
11
11
  *
12
12
  * @example
13
- * Here's how you can use the LineChart component in a Vue application:
14
13
  * ```vue
15
- * <template>
16
- <LineChart
17
- :dataOptions="lineChartProps.dataOptions"
18
- :dataSet="lineChartProps.dataSet"
19
- :filters="lineChartProps.filters"
20
- />
21
- * </template>
22
- *
23
14
  * <script setup lang="ts">
24
15
  * import { ref } from 'vue';
25
- * import { measureFactory, filterFactory } from '@sisense/sdk-data';
26
- * import * as DM from '../assets/sample-retail-model';
27
- * import { LineChart, type LineChartProps } from '@sisense/sdk-ui-vue';
28
-
29
- * const dimProductName = DM.DimProducts.ProductName;
30
- * const measureTotalRevenue = measureFactory.sum(DM.Fact_Sale_orders.OrderRevenue, 'Total Revenue');
31
- * const lineChartProps = ref<LineChartProps>({
32
- dataSet: DM.DataSource,
33
- dataOptions: {
34
- category: [dimProductName],
35
- value: [{ column: measureTotalRevenue, sortType: 'sortDesc' }],
36
- breakBy: [],
37
- },
38
- filters: [filterFactory.topRanking(dimProductName, measureTotalRevenue, 10)],
39
- });
16
+ * import { LineChart } from '@sisense/sdk-ui-vue';
17
+ * import { measureFactory } from '@sisense/sdk-data';
18
+ * import * as DM from './sample-ecommerce';
19
+ *
20
+ * const chartProps = ref({
21
+ * dataOptions: {
22
+ * category: [DM.Commerce.Date.Quarters],
23
+ * value: [measureFactory.sum(DM.Commerce.Revenue, 'Total Revenue')],
24
+ * breakBy: [DM.Commerce.Condition],
25
+ * },
26
+ * });
27
+ * </script>
28
+ *
29
+ * <template>
30
+ * <LineChart :dataSet="DM.DataSource" :dataOptions="chartProps.dataOptions" />
31
+ * </template>
40
32
  * ```
41
- * <img src="media://vue-line-chart-example.png" width="800px" />
33
+ * <img src="media://line-chart-example-1.png" width="700px" />
42
34
  * @param props - Line chart properties
43
35
  * @returns Line Chart component
44
36
  * @group Charts