Skip to content

Commit

Permalink
VueUiSparkline add verticalIndicator color & strokeDasharray options
Browse files Browse the repository at this point in the history
  • Loading branch information
graphieros committed Nov 26, 2023
1 parent 7db1b4e commit 8baddb7
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 6 deletions.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,40 @@ Available components:
- [VueUiScreenshot](https://vue-data-ui.graphieros.com/docs#vue-ui-screenshot)
- [VueUiSkeleton](https://vue-data-ui.graphieros.com/docs#vue-ui-skeleton)
- [VueUiDashboard](https://vue-data-ui.graphieros.com/docs#vue-ui-dashboard)
- [VueUiAnnotator](https://vue-data-ui.graphieros.com/docs#vue-ui-annotator)
- [VueUiAnnotator](https://vue-data-ui.graphieros.com/docs#vue-ui-annotator)

# Installation
```
npm i vue-data-ui
```

You can declare components globally in your main.js:

```
import { createApp } from 'vue'
import App from "./App.vue";
// Include the css;
import "vue-data-ui/style.css";
// You can declare Vue Data UI components globally
import { VueUiRadar } from "vue-data-ui";
const app = createApp(App);
app.component("VueUiRadar", VueUiRadar);
app.mount('#app');
```

Or you can import just what you need in your files:

```
<script setup>
import { VueUiRadar, VueUiXy } from "vue-data-ui";
</script>
```

## Typescript
Types are available in the 'vue-data-ui.d.ts' file under the types directory of the package.

## Nuxt
[Check this repo for a boilerplate implementation in Nuxt](https://github.com/graphieros/vue-data-ui-nuxt)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-data-ui",
"private": false,
"version": "1.9.6",
"version": "1.9.7",
"type": "module",
"description": "A user-empowering data visualization Vue components library",
"keywords": [
Expand Down
3 changes: 2 additions & 1 deletion src/components/vue-ui-sparkline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,10 @@ const isBar = computed(() => {
:x2="plot.x"
:y1="drawingArea.top - 6"
:y2="drawingArea.bottom"
:stroke="plot.color"
:stroke="sparklineConfig.style.verticalIndicator.color || plot.color"
:stroke-width="sparklineConfig.style.verticalIndicator.strokeWidth"
stroke-linecap="round"
:stroke-dasharray="sparklineConfig.style.verticalIndicator.strokeDasharray || 0"
/>
</g>

Expand Down
4 changes: 3 additions & 1 deletion src/default_configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,9 @@
},
"verticalIndicator": {
"show": true,
"strokeWidth": 1.5
"strokeWidth": 1.5,
"color": "#3366cc",
"strokeDasharray": 3
},
"dataLabel": {
"position": "left",
Expand Down
2 changes: 2 additions & 0 deletions types/vue-data-ui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2235,6 +2235,8 @@ declare module 'vue-data-ui' {
verticalIndicator?: {
show?: boolean;
strokeWidth?: number;
color?: string;
strokeDasharray?: number;
};
dataLabel?: {
position?: "left" | "right";
Expand Down

0 comments on commit 8baddb7

Please sign in to comment.