0.9.34 • Published 2 years ago

vue-ganttastic v0.9.34

Weekly downloads
98
License
MIT
Repository
github
Last release
2 years ago

vue-ganttastic

A simple and easy-to-use Gantt chart component for Vue.js

Using Vue 3? Check out the Vue-Ganttastic v2 and the corresponding npm package.

Homepage

Homepage of the project

Installation

You can install and use Vue-Ganttastic in your project using npm:

npm install vue-ganttastic

Moment.js is a peer-dependency of Vue-Ganttastic. In order for Vue-Ganttastic to work correctly, you need to install it in your project:

npm install moment

Basic Usage

Import the components GGanttChart and GGanttRow.
Use g-gantt-chart in your template, pass the desired chart start and chart end time as props (chart-start and chart-end) and add g-gantt-rows to the default template slot.
Pass an array containing your bar objects to every row using the bars prop, while specifying the name of the properties in your bar objects that stand for the bar start and bar end time using the props bar-start and bar-end

For more detailed information, such as how to style the bars or additional configuration options, please refer to the docs on the project's homepage (coming soon).

The following code showcases a simple usage example in a .vue SFC (Single File Component)

<template>
  ...

  <g-gantt-chart
    :chart-start="myChartStart"
    :chart-end="myChartEnd"
  >
    <g-gantt-row
      v-for="row in rows"
      :key="row.label"
      :label="row.label"
      :bars="row.bars"
      bar-start="myStart"
      bar-end="myEnd"
    />
  </g-gantt-chart>

  ...
</template>

<script>

import {GGanttChart, GGanttRow} from 'vue-ganttastic'

export default {

  ...

  components:{
    GGanttChart,
    GGanttRow
  },

  data(){
    return {
      myChartStart: "2020-03-01 00:00",
      myChartEnd: "2020-03-03 00:00",
      rows: [
        {
          label: "My row #1",
          bars: [
            {
              myStart: "2020-03-01 12:10",
              myEnd: "2020-03-01 16:35"
            }
          ]
        },
        {
          label: "My row #2",
          bars: [
            {
              myStart: "2020-03-02 01:00",
              myEnd: "2020-03-02 12:00"
            },
            {
              myStart: "2020-03-02 13:00",
              myEnd: "2020-03-02 22:00"
            }
          ]
        }
      ]
    }
  }

  ...

}
</script>

Contributing (run and build project)

  1. Clone the project
  2. Install the Vue CLI service, if you don't already have it installed:
      npm install -g @vue/cli
      npm install -g @vue/cli-service-global
  3. Install all dependencies:
    npm install
  4. Playground.vue is a dedicated Vue SFC where all Vue-Ganttastic features can be played around with and tested out. Get it running using:

      vue serve src/Playground.vue
  5. To build the project:

      npx bili --bundle-node-modules

Dependencies

Moment.js

License

MIT

0.9.34

2 years ago

0.9.33

2 years ago

0.9.31

3 years ago

0.9.32

3 years ago

0.9.30

3 years ago

0.9.26

3 years ago

0.9.27

3 years ago

0.9.24

4 years ago

0.9.25

4 years ago

0.9.23

4 years ago

0.9.22

4 years ago

0.9.20

4 years ago

0.9.21

4 years ago

0.9.19

4 years ago

0.9.18

4 years ago

0.9.17

4 years ago

0.9.16

4 years ago

0.9.15

4 years ago

0.9.14

4 years ago

0.9.13

4 years ago

0.9.11

4 years ago

0.9.10

4 years ago

0.9.9

4 years ago

0.9.8

4 years ago

0.9.7

4 years ago

0.9.6

4 years ago

0.9.5

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago