Skip to content

Commit 7d43459

Browse files
Adding the Angular Spreadsheet Chart Sample
Adding the Angular Spreadsheet Chart Sample
1 parent 94cb9b3 commit 7d43459

File tree

12 files changed

+430
-2
lines changed

12 files changed

+430
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,23 @@
1-
# how-to-insert-charts-in-an-angular-spreadsheet
2-
A quick-start project that helps you insert a chart in the Syncfusion Angular Spreadsheet. In this project, a chart has been inserted in a specific cell using both the chart property and the "insertChart" method. To enable or disable this feature, use the "allowChart" property in the Spreadsheet component.
1+
# How to Select a Row or Cell in the Vue Gantt Chart
2+
3+
A quick start project that allows you to perform selection in the Vue Gantt Chart component of Syncfusion. It also includes a code example to select one or more rows and cells using built-in properties of Vue Gantt Chart.
4+
5+
Refer to the following selection documentation for the Syncfusion Vue Gantt Chart component:
6+
https://helpej2.syncfusion.com/vue/documentation/gantt/selection/selection
7+
8+
Check out this online selection example of the Syncfusion Vue Gantt Chart component:
9+
https://ej2.syncfusion.com/vue/demos/#/material/gantt/selection.html
10+
11+
Refer to the following documentation for the feature modules in the Syncfusion Vue Gantt Chart component:
12+
https://ej2.syncfusion.com/vue/documentation/gantt/module
13+
14+
Refer to the following Syncfusion Vue Gantt Chart Getting Started video:
15+
https://www.youtube.com/watch?v=S1GbWmVcre0
16+
17+
## Project prerequisites
18+
19+
Make sure that you have the latest versions of Vue, Node, Vue Class Component, and Visual Studio Code in your machine before starting to work on this project.
20+
21+
### How to run this application?
22+
23+
To run this application, you need to clone the `how-to-select-a-row-or-cell-in-the-vue-gantt-chart-component` repository and then open it in Visual Studio Code. Now, simply install all the necessary react packages into your current project using the `npm install` command and run your project using the `npm run serve` command.

babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

jsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "esnext",
5+
"baseUrl": "./",
6+
"moduleResolution": "node",
7+
"paths": {
8+
"@/*": [
9+
"src/*"
10+
]
11+
},
12+
"lib": [
13+
"esnext",
14+
"dom",
15+
"dom.iterable",
16+
"scripthost"
17+
]
18+
}
19+
}

package.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "myvueproject",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vue-cli-service serve",
7+
"build": "vue-cli-service build",
8+
"lint": "vue-cli-service lint"
9+
},
10+
"dependencies": {
11+
"@syncfusion/ej2-vue-buttons": "^21.2.3",
12+
"@syncfusion/ej2-vue-gantt": "^21.1.38",
13+
"core-js": "^3.8.3",
14+
"vue": "^3.2.13"
15+
},
16+
"devDependencies": {
17+
"@babel/core": "^7.12.16",
18+
"@babel/eslint-parser": "^7.12.16",
19+
"@vue/cli-plugin-babel": "~5.0.0",
20+
"@vue/cli-plugin-eslint": "~5.0.0",
21+
"@vue/cli-service": "~5.0.0",
22+
"eslint": "^7.32.0",
23+
"eslint-plugin-vue": "^8.0.3"
24+
},
25+
"eslintConfig": {
26+
"root": true,
27+
"env": {
28+
"node": true
29+
},
30+
"extends": [
31+
"plugin:vue/vue3-essential",
32+
"eslint:recommended"
33+
],
34+
"parserOptions": {
35+
"parser": "@babel/eslint-parser"
36+
},
37+
"rules": {}
38+
},
39+
"browserslist": [
40+
"> 1%",
41+
"last 2 versions",
42+
"not dead",
43+
"not ie 11"
44+
]
45+
}

public/favicon.ico

4.19 KB
Binary file not shown.

public/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8+
<title><%= htmlWebpackPlugin.options.title %></title>
9+
</head>
10+
<body>
11+
<noscript>
12+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
13+
</noscript>
14+
<div id="app"></div>
15+
<!-- built files will be auto injected -->
16+
</body>
17+
</html>

src/App.vue

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<template>
2+
<!-- :selectedRowIndex="3" -->
3+
<ejs-button style="margin: 2px;" v-on:click="btnClick">Get Record Details</ejs-button>
4+
<ejs-gantt ref="gantt" :dataSource="data"
5+
:taskFields="taskFields"
6+
:treeColumnIndex="1"
7+
:selectionSettings="selectionOptions"
8+
:allowSelection="false"
9+
:height="450">
10+
<e-columns>
11+
<e-column field="TaskID" headerText="Task ID" width="120" textAlign="Right"></e-column>
12+
<e-column field="TaskName" headerText="Task Name" textAlign="Left" width="200"></e-column>
13+
<e-column field="StartDate" headerText="Start Date" textAlign="Right" format="dd/MM/yyyy" width="120"></e-column>
14+
<e-column field="Duration" headerText="Duration" textAlign="Right" width="120"></e-column>
15+
</e-columns>
16+
</ejs-gantt>
17+
</template>
18+
19+
<script>
20+
import {GanttComponent, ColumnsDirective, ColumnDirective, Selection} from '@syncfusion/ej2-vue-gantt'
21+
import {ButtonComponent} from '@syncfusion/ej2-vue-buttons'
22+
import {projectData} from './data.js'
23+
export default{
24+
name: 'App',
25+
components: {
26+
'ejs-gantt': GanttComponent,
27+
'e-columns': ColumnsDirective,
28+
'e-column': ColumnDirective,
29+
'ejs-button': ButtonComponent
30+
},
31+
methods:{
32+
btnClick(){
33+
let ganttObj = this.$refs.gantt.ej2Instances;
34+
// ganttObj.selectRow(3);
35+
// ganttObj.selectRows([0,2,3,7,8]);
36+
// ganttObj.clearSelection();
37+
console.log(ganttObj.selectionModule.getSelectedRowIndexes())
38+
console.log(ganttObj.selectionModule.getSelectedRecords())
39+
}
40+
},
41+
provide:{
42+
gantt: [Selection]
43+
},
44+
data(){
45+
return{
46+
data: projectData,
47+
selectionOptions:{
48+
type: 'Multiple',
49+
mode: 'Row',
50+
enableToggle: true
51+
},
52+
taskFields:{
53+
id: 'TaskID',
54+
name: 'TaskName',
55+
startDate: 'StartDate',
56+
endDate: 'EndDate',
57+
duration: 'Duration',
58+
progress: 'Progress',
59+
dependency: 'Predecessor',
60+
child: 'subtasks'
61+
},
62+
}
63+
}
64+
}
65+
66+
</script>
67+
68+
<style>
69+
@import url("https://cdn.syncfusion.com/ej2/material.css");
70+
</style>
71+

src/assets/logo.png

6.69 KB
Loading

src/components/HelloWorld.vue

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<template>
2+
<div class="hello">
3+
<h1>{{ msg }}</h1>
4+
<p>
5+
For a guide and recipes on how to configure / customize this project,<br>
6+
check out the
7+
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
8+
</p>
9+
<h3>Installed CLI Plugins</h3>
10+
<ul>
11+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
12+
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
13+
</ul>
14+
<h3>Essential Links</h3>
15+
<ul>
16+
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
17+
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
18+
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
19+
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
20+
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
21+
</ul>
22+
<h3>Ecosystem</h3>
23+
<ul>
24+
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
25+
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
26+
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
27+
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
28+
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
29+
</ul>
30+
</div>
31+
</template>
32+
33+
<script>
34+
export default {
35+
name: 'HelloWorld',
36+
props: {
37+
msg: String
38+
}
39+
}
40+
</script>
41+
42+
<!-- Add "scoped" attribute to limit CSS to this component only -->
43+
<style scoped>
44+
h3 {
45+
margin: 40px 0 0;
46+
}
47+
ul {
48+
list-style-type: none;
49+
padding: 0;
50+
}
51+
li {
52+
display: inline-block;
53+
margin: 0 10px;
54+
}
55+
a {
56+
color: #42b983;
57+
}
58+
</style>

0 commit comments

Comments
 (0)