Skip to content

Commit 2aebea5

Browse files
authoredOct 22, 2024··
Add files via upload
1 parent 82a7825 commit 2aebea5

File tree

10 files changed

+235
-2
lines changed

10 files changed

+235
-2
lines changed
 

‎README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,31 @@
1-
# getting-started-with-the-vue-linear-gauge-component
2-
A quick start project that shows how to create and configure the Syncfusion Vue Linear Gauge component in a Vue app. This sample explains how to set a specific axis pointer value as well as how to customize an axis line height and width. It also explains how to add multiple axis ranges.
1+
# Getting Started with the Vue Linear Gauge Component
2+
3+
A quick start project that shows how to create and configure the Syncfusion Vue Linear Gauge component in a Vue app. This sample explains how to set a specific axis pointer value as well as how to customize an axis line height and width. It also explains how to add multiple axis ranges.
4+
5+
Example: https://ej2.syncfusion.com/vue/demos/#/bootstrap5/linear-gauge/default-functionalities.html
6+
7+
Documentation: https://ej2.syncfusion.com/vue/documentation/linear-gauge/getting-started-vue-3
8+
9+
## Project pre-requisites
10+
Make sure that your machine has the following setup before starting to work on this project.
11+
12+
Visual Studio Code
13+
14+
Node.js
15+
16+
Vue
17+
18+
## How to run this application?
19+
To run this application, you need to first clone the getting-started-with-the-vue-linear-gauge-component repository and then navigate to its appropriate path where it has been located in your system.
20+
To do so, open the command prompt and run the below commands one after the other.
21+
```
22+
git clone getting-started-with-the-vue-linear-gauge-component linear-gauge
23+
cd linear-gauge
24+
```
25+
## Installation
26+
Once done with downloading, next you need to install the necessary packages required to run this application locally. The `npm install` command will install all the needed Vue packages into your current project and to do so, run the below command.
27+
```
28+
npm install
29+
```
30+
## Running on development server
31+
Run `npm run dev` command. Navigate to `http://localhost:8080/`. The app will automatically reload if you change any of the source files.

‎index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.js"></script>
12+
</body>
13+
</html>

‎package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "myvueapp",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@syncfusion/ej2-vue-lineargauge": "^27.1.48",
13+
"vue": "^3.4.37"
14+
},
15+
"devDependencies": {
16+
"@vitejs/plugin-vue": "^5.1.2",
17+
"vite": "^5.4.1"
18+
}
19+
}

‎public/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

‎src/App.vue

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<script setup>
2+
import { LinearGaugeComponent as EjsLineargauge, AxesDirective as EAxes, AxisDirective as EAxis,
3+
PointerDirective as EPointer, PointersDirective as EPointers,
4+
RangesDirective as ERanges, RangeDirective as ERange
5+
} from '@syncfusion/ej2-vue-lineargauge';
6+
const line = {
7+
height: 350,
8+
width: 7,
9+
color: '#4286f4'
10+
};
11+
const labelStyle = {
12+
format: "{value}°C"
13+
};
14+
</script>
15+
16+
<template>
17+
<ejs-lineargauge >
18+
<e-axes>
19+
<e-axis :line='line' :labelStyle='labelStyle'>
20+
<e-pointers>
21+
<e-pointer value=80></e-pointer>
22+
</e-pointers>
23+
<e-ranges>
24+
<e-range start=30 end=60></e-range>
25+
<e-range start=60 end=90 color="#41f47f"></e-range>
26+
</e-ranges>
27+
</e-axis>
28+
</e-axes>
29+
</ejs-lineargauge>
30+
</template>
31+
32+
<style>
33+
34+
</style>

‎src/assets/vue.svg

Lines changed: 1 addition & 0 deletions
Loading

‎src/components/HelloWorld.vue

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<script setup>
2+
import { ref } from 'vue'
3+
4+
defineProps({
5+
msg: String,
6+
})
7+
8+
const count = ref(0)
9+
</script>
10+
11+
<template>
12+
<h1>{{ msg }}</h1>
13+
14+
<div class="card">
15+
<button type="button" @click="count++">count is {{ count }}</button>
16+
<p>
17+
Edit
18+
<code>components/HelloWorld.vue</code> to test HMR
19+
</p>
20+
</div>
21+
22+
<p>
23+
Check out
24+
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
25+
>create-vue</a
26+
>, the official Vue + Vite starter
27+
</p>
28+
<p>
29+
Learn more about IDE Support for Vue in the
30+
<a
31+
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
32+
target="_blank"
33+
>Vue Docs Scaling up Guide</a
34+
>.
35+
</p>
36+
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
37+
</template>
38+
39+
<style scoped>
40+
.read-the-docs {
41+
color: #888;
42+
}
43+
</style>

‎src/main.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createApp } from 'vue'
2+
import './style.css'
3+
import App from './App.vue'
4+
import {registerLicense} from '@syncfusion/ej2-base';
5+
registerLicense("Your License Key");
6+
7+
createApp(App).mount('#app')

‎src/style.css

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
:root {
2+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3+
line-height: 1.5;
4+
font-weight: 400;
5+
6+
color-scheme: light dark;
7+
color: rgba(255, 255, 255, 0.87);
8+
background-color: #242424;
9+
10+
font-synthesis: none;
11+
text-rendering: optimizeLegibility;
12+
-webkit-font-smoothing: antialiased;
13+
-moz-osx-font-smoothing: grayscale;
14+
}
15+
16+
a {
17+
font-weight: 500;
18+
color: #646cff;
19+
text-decoration: inherit;
20+
}
21+
a:hover {
22+
color: #535bf2;
23+
}
24+
25+
body {
26+
margin: 0;
27+
display: flex;
28+
place-items: center;
29+
min-width: 320px;
30+
min-height: 100vh;
31+
}
32+
33+
h1 {
34+
font-size: 3.2em;
35+
line-height: 1.1;
36+
}
37+
38+
button {
39+
border-radius: 8px;
40+
border: 1px solid transparent;
41+
padding: 0.6em 1.2em;
42+
font-size: 1em;
43+
font-weight: 500;
44+
font-family: inherit;
45+
background-color: #1a1a1a;
46+
cursor: pointer;
47+
transition: border-color 0.25s;
48+
}
49+
button:hover {
50+
border-color: #646cff;
51+
}
52+
button:focus,
53+
button:focus-visible {
54+
outline: 4px auto -webkit-focus-ring-color;
55+
}
56+
57+
.card {
58+
padding: 2em;
59+
}
60+
61+
#app {
62+
max-width: 1280px;
63+
margin: 0 auto;
64+
padding: 2rem;
65+
text-align: center;
66+
}
67+
68+
@media (prefers-color-scheme: light) {
69+
:root {
70+
color: #213547;
71+
background-color: #ffffff;
72+
}
73+
a:hover {
74+
color: #747bff;
75+
}
76+
button {
77+
background-color: #f9f9f9;
78+
}
79+
}

‎vite.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vite'
2+
import vue from '@vitejs/plugin-vue'
3+
4+
// https://vitejs.dev/config/
5+
export default defineConfig({
6+
plugins: [vue()],
7+
})

0 commit comments

Comments
 (0)
Please sign in to comment.