diff --git a/docs/GGanttChart.md b/docs/GGanttChart.md index 416b7c22..cdf108c4 100644 --- a/docs/GGanttChart.md +++ b/docs/GGanttChart.md @@ -1,23 +1,24 @@ # API: GGanttChart The main component of Vue Ganttastic. Represents an entire chart and is meant to have at least one `g-gantt-row` child component. ## Props -| Prop | Type | Default | Description | -|-------------|---------|---------|------------------------------| -| `chart-start` | string | | Start date-time of the chart. -| `chart-end` | string | | End date-time of the chart. -| `precision` | string? | `"hour"` | Display precision of the time-axis. Possible values: `hour`, `day` and `month`. | -| `bar-start` | string | | Name of the property in bar objects that represents the start date. -| `bar-end` | string | | Name of the property in bar objects that represents the end date . -| `date-format` | string \| false | `"YYYY-MM-DD HH:mm"` | Datetime string format of `chart-start`, `chart-end` and the values of the `bar-start`, `bar-end` properties in bar objects. See [Day.js format tokens](https://day.js.org/docs/en/parse/string-format). If the aforementioned properties are native JavaScript [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) objects in your use case, pass `false`. -| `width` | string? | `"100%"` | Width of the chart (e.g. `80%` or `800px`) -| `hide-timeaxis` | boolean? | `false` | Toggle visibility of the time axis. -| `color-scheme` | string \| ColorScheme | `"default"` | Color scheme (theme) of the chart. Either use the name of one of the predefined schemes or pass a color-scheme-object of your own. See [color schemes](#color-schemes). -| `grid` | string? | `false` | Toggle visibility of background grid. -| `push-on-overlap` | boolean? | `false` | Specifies whether bars "push one another" when dragging and overlaping. -| `no-overlap` | boolean? | `false` | If `push-on-overlap` is `false`, toggle this to prevent overlaps after drag by snapping the dragged bar back to its original position. -| `row-height` | number? | `40` |Height of each row in pixels. -| `highlighted-units` | number[]? | `[]` | The time units specified here will be visually highlighted in the chart with a mild opaque color. -| `font` | `string` | `"Helvetica"`| Font family of the chart. +| Prop | Type | Default | Description | +|---------------------|-----------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `chart-start` | string | | Start date-time of the chart. | +| `chart-end` | string | | End date-time of the chart. | +| `precision` | string? | `"hour"` | Display precision of the time-axis. Possible values: `hour`, `day` and `month`. | +| `bar-start` | string | | Name of the property in bar objects that represents the start date. | +| `bar-end` | string | | Name of the property in bar objects that represents the end date . | +| `date-format` | string \| false | `"YYYY-MM-DD HH:mm"` | Datetime string format of `chart-start`, `chart-end` and the values of the `bar-start`, `bar-end` properties in bar objects. See [Day.js format tokens](https://day.js.org/docs/en/parse/string-format). If the aforementioned properties are native JavaScript [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) objects in your use case, pass `false`. | +| `width` | string? | `"100%"` | Width of the chart (e.g. `80%` or `800px`) | +| `hide-timeaxis` | boolean? | `false` | Toggle visibility of the time axis. | +| `color-scheme` | string \| ColorScheme | `"default"` | Color scheme (theme) of the chart. Either use the name of one of the predefined schemes or pass a color-scheme-object of your own. See [color schemes](#color-schemes). | +| `grid` | string? | `false` | Toggle visibility of background grid. | +| `push-on-overlap` | boolean? | `false` | Specifies whether bars "push one another" when dragging and overlaping. | +| `no-overlap` | boolean? | `false` | If `push-on-overlap` is `false`, toggle this to prevent overlaps after drag by snapping the dragged bar back to its original position. | +| `row-height` | number? | `40` | Height of each row in pixels. | +| `highlighted-units` | number[]? | `[]` | The time units specified here will be visually highlighted in the chart with a mild opaque color. | +| `highlight-sundays` | boolean? | `false` | Sundays will be visually highlighted in the chart with a mild opaque color and the dates text color will be changed to a dark red. | +| `font` | `string` | `"Helvetica"` | Font family of the chart. | ## Custom Events | Event name | Event data | diff --git a/src/components/GGanttChart.vue b/src/components/GGanttChart.vue index a96f7ea6..7b00ffad 100644 --- a/src/components/GGanttChart.vue +++ b/src/components/GGanttChart.vue @@ -67,6 +67,7 @@ export interface GGanttChartProps { noOverlap?: boolean rowHeight?: number highlightedUnits?: number[] + highlightSundays?: boolean font?: string } @@ -89,6 +90,7 @@ const props = withDefaults(defineProps(), { noOverlap: false, rowHeight: 40, highlightedUnits: () => [], + highlightSundays: false, font: "inherit" }) diff --git a/src/components/GGanttGrid.vue b/src/components/GGanttGrid.vue index 23462e02..fedebb2c 100644 --- a/src/components/GGanttGrid.vue +++ b/src/components/GGanttGrid.vue @@ -1,12 +1,12 @@