vue-chrts 0.0.118 → 0.0.119
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/.vscode/extensions.json +3 -0
- package/image.png +0 -0
- package/index.html +14 -0
- package/package.json +1 -5
- package/src/components/Area/AreaChart.vue +141 -0
- package/src/components/Area/index.ts +1 -0
- package/src/components/AreaStacked/AreaStackedChart.vue +51 -0
- package/{dist/components/AreaStacked/index.d.ts → src/components/AreaStacked/index.ts} +1 -1
- package/src/components/Bar/BarChart.vue +130 -0
- package/src/components/Bar/index.ts +1 -0
- package/src/components/Crosshair/Crosshair.vue +46 -0
- package/src/components/Crosshair/index.ts +1 -0
- package/src/components/Donut/DonutChart.vue +71 -0
- package/src/components/Donut/index.ts +1 -0
- package/src/components/Line/LineChart.vue +94 -0
- package/src/components/Line/index.ts +1 -0
- package/src/components/Tooltip.vue +17 -0
- package/src/components.ts +6 -0
- package/src/index.ts +6 -0
- package/src/shims-vue.d.ts +1 -0
- package/src-demo/AdminTemplate.vue +5 -0
- package/src-demo/App.vue +37 -0
- package/src-demo/AreaChartPage.vue +125 -0
- package/src-demo/BarChartPage.vue +166 -0
- package/src-demo/DashboardTemplate.vue +687 -0
- package/src-demo/Homepage.vue +325 -0
- package/src-demo/LineChartPage.vue +140 -0
- package/src-demo/assets/main.css +34 -0
- package/src-demo/components/Progress/Progress.vue +42 -0
- package/src-demo/components/Progress/index.ts +1 -0
- package/src-demo/components/Status/Status.vue +95 -0
- package/src-demo/components/Status/index.ts +1 -0
- package/src-demo/components/charts.ts +37 -0
- package/src-demo/components/index.ts +49 -0
- package/src-demo/data/AreaChartData.ts +294 -0
- package/src-demo/data/BarChartData.ts +79 -0
- package/src-demo/data/IncomeExpenseData.ts +189 -0
- package/src-demo/data/InvestmentData.ts +352 -0
- package/src-demo/data/RevenueData.ts +58 -0
- package/src-demo/data/VisitorsData.ts +260 -0
- package/src-demo/elements/Button.vue +13 -0
- package/src-demo/elements/Card.vue +17 -0
- package/src-demo/elements/Dropdown.vue +112 -0
- package/src-demo/elements/Logo.vue +8 -0
- package/src-demo/elements/Table.vue +363 -0
- package/src-demo/elements/TopBar.vue +40 -0
- package/src-demo/index.ts +58 -0
- package/tsconfig.json +11 -0
- package/vite.config.ts +60 -0
- package/dist/components/Area/AreaChart.vue.d.ts +0 -37
- package/dist/components/Area/index.d.ts +0 -1
- package/dist/components/AreaStacked/AreaStackedChart.vue.d.ts +0 -18
- package/dist/components/Bar/BarChart.vue.d.ts +0 -37
- package/dist/components/Bar/index.d.ts +0 -1
- package/dist/components/Crosshair/Crosshair.vue.d.ts +0 -38
- package/dist/components/Crosshair/index.d.ts +0 -1
- package/dist/components/Donut/DonutChart.vue.d.ts +0 -31
- package/dist/components/Donut/index.d.ts +0 -1
- package/dist/components/Line/LineChart.vue.d.ts +0 -28
- package/dist/components/Line/index.d.ts +0 -1
- package/dist/components/Tooltip.vue.d.ts +0 -14
- package/dist/components.d.ts +0 -6
- package/dist/index.cjs +0 -502
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -9615
- package/dist/index.js.map +0 -1
- /package/{dist → public}/vite.svg +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { AreaChart as BaseArea } from "./../src/components/Area";
|
|
3
|
+
import { AreaStackedChart } from "./../src/components";
|
|
4
|
+
|
|
5
|
+
import Card from "./elements/Card.vue";
|
|
6
|
+
|
|
7
|
+
import { CurveType } from "@unovis/ts";
|
|
8
|
+
import {
|
|
9
|
+
AreaChartData1,
|
|
10
|
+
AreaChartData2,
|
|
11
|
+
AreaChartData3,
|
|
12
|
+
AreaChartData4,
|
|
13
|
+
categories2,
|
|
14
|
+
categories3,
|
|
15
|
+
categories4,
|
|
16
|
+
categories5,
|
|
17
|
+
} from "./data/AreaChartData";
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div class="space-y-8 pb-24 pt-8">
|
|
22
|
+
<div class="max-w-7xl mx-auto space-y-4">
|
|
23
|
+
<div class="mb-8 space-y-4">
|
|
24
|
+
<h1 class="text-4xl font-bold">Area Chart</h1>
|
|
25
|
+
<p class="text-lg font-medium text-gray-500">
|
|
26
|
+
Graph with lines connecting data points and shaded areas between the
|
|
27
|
+
lines and the x-axis.
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="grid grid-cols-3 gap-4 max-w-7xl mx-auto py-4">
|
|
33
|
+
<Card>
|
|
34
|
+
<template #header>
|
|
35
|
+
<h2 class="heading-2">Area Chart multiple lines</h2>
|
|
36
|
+
<!-- <p class="text-gray-500">Website visitors per device</p> -->
|
|
37
|
+
</template>
|
|
38
|
+
<BaseArea
|
|
39
|
+
:data="AreaChartData1"
|
|
40
|
+
:height="200"
|
|
41
|
+
y-label="Number of visits"
|
|
42
|
+
:categories="categories3"
|
|
43
|
+
:x-formatter="(i: number): string => `${AreaChartData1[i].date}`"
|
|
44
|
+
:curve-type="CurveType.MonotoneX"
|
|
45
|
+
/>
|
|
46
|
+
</Card>
|
|
47
|
+
|
|
48
|
+
<Card>
|
|
49
|
+
<template #header>
|
|
50
|
+
<h2 class="text-xl my-2 font-bold">Area Chart with single line</h2>
|
|
51
|
+
</template>
|
|
52
|
+
<BaseArea
|
|
53
|
+
:data="AreaChartData2"
|
|
54
|
+
:height="200"
|
|
55
|
+
x-label="Time"
|
|
56
|
+
y-label="Temperature"
|
|
57
|
+
:categories="categories2"
|
|
58
|
+
:y-num-ticks="4"
|
|
59
|
+
:x-num-ticks="7"
|
|
60
|
+
:x-formatter="(i: number): string => `${AreaChartData2[i].hour}`"
|
|
61
|
+
:curve-type="CurveType.Basis"
|
|
62
|
+
/>
|
|
63
|
+
</Card>
|
|
64
|
+
|
|
65
|
+
<Card>
|
|
66
|
+
<template #header>
|
|
67
|
+
<h2 class="text-xl my-2 font-bold">Area Chart Stacked</h2>
|
|
68
|
+
</template>
|
|
69
|
+
<AreaStackedChart :data="AreaChartData3" :categories="categories4" />
|
|
70
|
+
</Card>
|
|
71
|
+
|
|
72
|
+
<Card>
|
|
73
|
+
<template #header>
|
|
74
|
+
<h2 class="text-xl my-2 font-bold">Area Chart Natrual</h2>
|
|
75
|
+
</template>
|
|
76
|
+
<BaseArea
|
|
77
|
+
:data="AreaChartData4"
|
|
78
|
+
:height="200"
|
|
79
|
+
x-label="Month"
|
|
80
|
+
y-label="Score"
|
|
81
|
+
:categories="categories5"
|
|
82
|
+
:y-num-ticks="4"
|
|
83
|
+
:x-num-ticks="7"
|
|
84
|
+
:x-formatter="(i: number): string => `${AreaChartData2[i].hour}`"
|
|
85
|
+
:curve-type="CurveType.Natural"
|
|
86
|
+
/>
|
|
87
|
+
</Card>
|
|
88
|
+
|
|
89
|
+
<Card>
|
|
90
|
+
<template #header>
|
|
91
|
+
<h2 class="text-xl my-2 font-bold">Area Chart Step</h2>
|
|
92
|
+
</template>
|
|
93
|
+
<BaseArea
|
|
94
|
+
:data="AreaChartData4"
|
|
95
|
+
:height="200"
|
|
96
|
+
x-label="Month"
|
|
97
|
+
y-label="Score"
|
|
98
|
+
:categories="categories5"
|
|
99
|
+
:y-num-ticks="4"
|
|
100
|
+
:x-num-ticks="7"
|
|
101
|
+
:x-formatter="(i: number): string => `${AreaChartData2[i].hour}`"
|
|
102
|
+
:curve-type="CurveType.Step"
|
|
103
|
+
/>
|
|
104
|
+
</Card>
|
|
105
|
+
|
|
106
|
+
<Card>
|
|
107
|
+
<template #header>
|
|
108
|
+
<h2 class="text-xl my-2 font-bold">Area Chart Default</h2>
|
|
109
|
+
</template>
|
|
110
|
+
<BaseArea
|
|
111
|
+
:data="AreaChartData4"
|
|
112
|
+
:height="200"
|
|
113
|
+
x-label="Month"
|
|
114
|
+
y-label="Score"
|
|
115
|
+
:categories="categories5"
|
|
116
|
+
:y-num-ticks="4"
|
|
117
|
+
:x-num-ticks="7"
|
|
118
|
+
:x-formatter="(i: number): string => {
|
|
119
|
+
return `${AreaChartData2[i].hour}`;
|
|
120
|
+
}"
|
|
121
|
+
/>
|
|
122
|
+
</Card>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { Orientation } from "@unovis/ts";
|
|
3
|
+
import { BarChart } from "./../src/components";
|
|
4
|
+
|
|
5
|
+
import Card from "./elements/Card.vue";
|
|
6
|
+
|
|
7
|
+
import { VisitorsData, VisitorsCartegories } from "./data/VisitorsData";
|
|
8
|
+
|
|
9
|
+
import { PaginationPosition } from './../src'
|
|
10
|
+
|
|
11
|
+
const RevenueData = [
|
|
12
|
+
{ month: "January", desktop: 186, mobile: 80 },
|
|
13
|
+
{ month: "February", desktop: 305, mobile: 200 },
|
|
14
|
+
{ month: "March", desktop: 237, mobile: 120 },
|
|
15
|
+
{ month: "April", desktop: 73, mobile: 190 },
|
|
16
|
+
{ month: "May", desktop: 209, mobile: 130 },
|
|
17
|
+
{ month: "June", desktop: 214, mobile: 140 },
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const RevenueCategories = {
|
|
21
|
+
desktop: { name: "Desktop", color: "#00dc82" },
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const RevenueCategoriesMultple = {
|
|
25
|
+
desktop: { name: "Desktop", color: "#00dc82" },
|
|
26
|
+
mobile: { name: "Mobile", color: "#156F36" },
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div class="space-y-8 pb-24 pt-8">
|
|
32
|
+
<div class="max-w-7xl mx-auto space-y-4">
|
|
33
|
+
<div class="mb-8 space-y-4">
|
|
34
|
+
<h1 class="text-4xl font-bold">Bar Chart</h1>
|
|
35
|
+
<p class="text-lg font-medium text-gray-500">
|
|
36
|
+
Bar charts to represent data, with bar lengths proportional to the
|
|
37
|
+
values they represent.
|
|
38
|
+
</p>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="grid grid-cols-3 gap-4 max-w-7xl mx-auto py-4">
|
|
43
|
+
<Card>
|
|
44
|
+
<template #header>
|
|
45
|
+
<h2 class="heading-2">Bar Chart Vertical</h2>
|
|
46
|
+
<!-- <p class="text-gray-500">Website visitors per device</p> -->
|
|
47
|
+
</template>
|
|
48
|
+
<BarChart
|
|
49
|
+
:data="RevenueData"
|
|
50
|
+
:height="250"
|
|
51
|
+
:categories="RevenueCategories"
|
|
52
|
+
:y-axis="['desktop']"
|
|
53
|
+
:xNumTicks="6"
|
|
54
|
+
:radius="4"
|
|
55
|
+
:y-formatter="(i: number) => i"
|
|
56
|
+
:x-formatter="(i: number): string => `${RevenueData[i].month }`"
|
|
57
|
+
:pagination-position="PaginationPosition.Top"
|
|
58
|
+
/>
|
|
59
|
+
</Card>
|
|
60
|
+
|
|
61
|
+
<Card>
|
|
62
|
+
<template #header>
|
|
63
|
+
<h2 class="heading-2">Bar Chart Horizontal</h2>
|
|
64
|
+
<!-- <p class="text-gray-500">Website visitors per device</p> -->
|
|
65
|
+
</template>
|
|
66
|
+
<BarChart
|
|
67
|
+
:data="RevenueData"
|
|
68
|
+
:height="250"
|
|
69
|
+
:categories="RevenueCategories"
|
|
70
|
+
:y-axis="['desktop']"
|
|
71
|
+
:xNumTicks="6"
|
|
72
|
+
:radius="4"
|
|
73
|
+
:bar-padding="0"
|
|
74
|
+
:orientation="Orientation.Horizontal"
|
|
75
|
+
:x-formatter="() => ''"
|
|
76
|
+
:y-formatter="(i: number): string => `${RevenueData[i].month }`"
|
|
77
|
+
:pagination-position="PaginationPosition.Top"
|
|
78
|
+
/>
|
|
79
|
+
</Card>
|
|
80
|
+
|
|
81
|
+
<Card>
|
|
82
|
+
<template #header>
|
|
83
|
+
<h2 class="heading-2">Bar Chart Group</h2>
|
|
84
|
+
<!-- <p class="text-gray-500">Website visitors per device</p> -->
|
|
85
|
+
</template>
|
|
86
|
+
<BarChart
|
|
87
|
+
:data="RevenueData"
|
|
88
|
+
:height="250"
|
|
89
|
+
:categories="RevenueCategoriesMultple"
|
|
90
|
+
:y-axis="['desktop', 'mobile']"
|
|
91
|
+
:group-padding="0"
|
|
92
|
+
:bar-padding="0.2"
|
|
93
|
+
:xNumTicks="6"
|
|
94
|
+
:radius="4"
|
|
95
|
+
:y-formatter="(i: number) => i"
|
|
96
|
+
:x-formatter="(i: number): string => `${RevenueData[i].month }`"
|
|
97
|
+
:pagination-position="PaginationPosition.Top"
|
|
98
|
+
/>
|
|
99
|
+
</Card>
|
|
100
|
+
|
|
101
|
+
<Card>
|
|
102
|
+
<template #header>
|
|
103
|
+
<h2 class="heading-2">Bar Chart Stacked</h2>
|
|
104
|
+
<!-- <p class="text-gray-500">Website visitors per device</p> -->
|
|
105
|
+
</template>
|
|
106
|
+
<BarChart
|
|
107
|
+
:data="RevenueData"
|
|
108
|
+
:stacked="true"
|
|
109
|
+
:height="250"
|
|
110
|
+
:categories="RevenueCategoriesMultple"
|
|
111
|
+
:y-axis="['desktop', 'mobile']"
|
|
112
|
+
:group-padding="0"
|
|
113
|
+
:bar-padding="0.2"
|
|
114
|
+
:xNumTicks="6"
|
|
115
|
+
:radius="4"
|
|
116
|
+
:y-formatter="(i: number) => i"
|
|
117
|
+
:x-formatter="(i: number): string => `${RevenueData[i].month }`"
|
|
118
|
+
:pagination-position="PaginationPosition.Top"
|
|
119
|
+
/>
|
|
120
|
+
</Card>
|
|
121
|
+
|
|
122
|
+
<Card>
|
|
123
|
+
<template #header>
|
|
124
|
+
<h2 class="heading-2">Bar Chart Vertical</h2>
|
|
125
|
+
<!-- <p class="text-gray-500">Website visitors per device</p> -->
|
|
126
|
+
</template>
|
|
127
|
+
<BarChart
|
|
128
|
+
:data="VisitorsData.slice(0, 11)"
|
|
129
|
+
:height="250"
|
|
130
|
+
:categories="VisitorsCartegories"
|
|
131
|
+
:y-axis="['visitors']"
|
|
132
|
+
:xNumTicks="1"
|
|
133
|
+
:radius="4"
|
|
134
|
+
:y-formatter="(i: number) => i"
|
|
135
|
+
:x-formatter="(i: number,): string => {
|
|
136
|
+
const date = new Date(VisitorsData[i].date)
|
|
137
|
+
return date.getMonth() + 1 + '/' + date.getDate() + '/' + date.getFullYear();
|
|
138
|
+
}"
|
|
139
|
+
:pagination-position="PaginationPosition.Top"
|
|
140
|
+
/>
|
|
141
|
+
</Card>
|
|
142
|
+
|
|
143
|
+
<Card>
|
|
144
|
+
<template #header>
|
|
145
|
+
<h2 class="heading-2">Bar Chart Stacked Horizontal</h2>
|
|
146
|
+
<!-- <p class="text-gray-500">Website visitors per device</p> -->
|
|
147
|
+
</template>
|
|
148
|
+
<BarChart
|
|
149
|
+
:data="RevenueData"
|
|
150
|
+
:stacked="true"
|
|
151
|
+
:orientation="Orientation.Horizontal"
|
|
152
|
+
:height="250"
|
|
153
|
+
:categories="RevenueCategoriesMultple"
|
|
154
|
+
:y-axis="['desktop', 'mobile']"
|
|
155
|
+
:group-padding="0"
|
|
156
|
+
:bar-padding="0.2"
|
|
157
|
+
:xNumTicks="6"
|
|
158
|
+
:radius="4"
|
|
159
|
+
:x-formatter="(i: number) => i"
|
|
160
|
+
:y-formatter="(i: number): string => `${RevenueData[i].month }`"
|
|
161
|
+
:pagination-position="PaginationPosition.Top"
|
|
162
|
+
/>
|
|
163
|
+
</Card>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</template>
|