Skip to content

Commit 8baddb7

Browse files
committed
VueUiSparkline add verticalIndicator color & strokeDasharray options
1 parent 7db1b4e commit 8baddb7

File tree

6 files changed

+47
-6
lines changed

6 files changed

+47
-6
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,40 @@ Available components:
5656
- [VueUiScreenshot](https://vue-data-ui.graphieros.com/docs#vue-ui-screenshot)
5757
- [VueUiSkeleton](https://vue-data-ui.graphieros.com/docs#vue-ui-skeleton)
5858
- [VueUiDashboard](https://vue-data-ui.graphieros.com/docs#vue-ui-dashboard)
59-
- [VueUiAnnotator](https://vue-data-ui.graphieros.com/docs#vue-ui-annotator)
59+
- [VueUiAnnotator](https://vue-data-ui.graphieros.com/docs#vue-ui-annotator)
60+
61+
# Installation
62+
```
63+
npm i vue-data-ui
64+
```
65+
66+
You can declare components globally in your main.js:
67+
68+
```
69+
import { createApp } from 'vue'
70+
import App from "./App.vue";
71+
// Include the css;
72+
import "vue-data-ui/style.css";
73+
74+
// You can declare Vue Data UI components globally
75+
import { VueUiRadar } from "vue-data-ui";
76+
77+
const app = createApp(App);
78+
79+
app.component("VueUiRadar", VueUiRadar);
80+
app.mount('#app');
81+
```
82+
83+
Or you can import just what you need in your files:
84+
85+
```
86+
<script setup>
87+
import { VueUiRadar, VueUiXy } from "vue-data-ui";
88+
</script>
89+
```
90+
91+
## Typescript
92+
Types are available in the 'vue-data-ui.d.ts' file under the types directory of the package.
93+
94+
## Nuxt
95+
[Check this repo for a boilerplate implementation in Nuxt](https://github.com/graphieros/vue-data-ui-nuxt)

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-data-ui",
33
"private": false,
4-
"version": "1.9.6",
4+
"version": "1.9.7",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/components/vue-ui-sparkline.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,10 @@ const isBar = computed(() => {
211211
:x2="plot.x"
212212
:y1="drawingArea.top - 6"
213213
:y2="drawingArea.bottom"
214-
:stroke="plot.color"
214+
:stroke="sparklineConfig.style.verticalIndicator.color || plot.color"
215215
:stroke-width="sparklineConfig.style.verticalIndicator.strokeWidth"
216216
stroke-linecap="round"
217+
:stroke-dasharray="sparklineConfig.style.verticalIndicator.strokeDasharray || 0"
217218
/>
218219
</g>
219220

src/default_configs.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,9 @@
14841484
},
14851485
"verticalIndicator": {
14861486
"show": true,
1487-
"strokeWidth": 1.5
1487+
"strokeWidth": 1.5,
1488+
"color": "#3366cc",
1489+
"strokeDasharray": 3
14881490
},
14891491
"dataLabel": {
14901492
"position": "left",

types/vue-data-ui.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,6 +2235,8 @@ declare module 'vue-data-ui' {
22352235
verticalIndicator?: {
22362236
show?: boolean;
22372237
strokeWidth?: number;
2238+
color?: string;
2239+
strokeDasharray?: number;
22382240
};
22392241
dataLabel?: {
22402242
position?: "left" | "right";

0 commit comments

Comments
 (0)