-
+
@@ -28,7 +31,7 @@
:key="childPoint.fullDatetime"
class="g-timeaxis-hour"
:style="{
- width: childPoint.widthPercentage + '%',
+ width: '30px',
background:
index % 2 === 0 ? themeColors.primary : themeColors.secondary,
color: themeColors.text,
@@ -55,7 +58,7 @@ import moment from 'moment'
export default {
name: 'GGanttTimeaxis',
- inject: ['ganttChartProps', 'getTimeUnit', 'getTimeFormat'],
+ inject: ['ganttChartProps', 'getTimeUnit', 'getTimeFormat', 'getTimeCount'],
props: {
chartStart: String,
@@ -230,29 +233,32 @@ export default {
.g-timeaxis-day,
.g-timeaxis-day > div {
display: flex;
- overflow: hidden;
+ /* overflow: hidden; */
}
#g-timeaxis {
position: sticky;
top: 0;
- width: 100%;
- height: 8%;
- min-height: 75px;
+ /* width: 100%; */
+ /* height: 8%; */
+ /* min-height: 75px; */
background: white;
z-index: 4;
box-shadow: 0px 1px 3px 2px rgba(50, 50, 50, 0.5);
}
#g-timeaxis > .g-timeaxis-empty-space {
- width: 20%; /* this has to be as wide as .ganttRowTitle in VGanttastic.css */
- height: 100%;
+ /* width: 20%; this has to be as wide as .ganttRowTitle in VGanttastic.css */
+ min-height: 100%;
background: #f5f5f5;
+ z-index: 5;
+ left: 0;
+ position: sticky;
}
#g-timeaxis > .g-timeaxis-days {
position: relative;
- width: 80%;
+ /* width: 80%; */
height: 100%;
}
@@ -290,7 +296,7 @@ export default {
align-items: flex-start;
flex-direction: column;
opacity: 0.5;
- width: 100%;
+ /* width: 100%; */
}
.g-timeaxis-hour-pin {
diff --git a/src/Playground.vue b/src/Playground.vue
index 1a2be11..ea262e0 100644
--- a/src/Playground.vue
+++ b/src/Playground.vue
@@ -11,7 +11,7 @@
timeaxisMode="day_hours"
:is-magnetic="isMagnetic"
:highlighted-hours="highlightedHours"
- :row-label-width="`${rowLabelWidth}%`"
+ :row-label-width="rowLabelWidth"
:row-height="rowHeight"
:theme="selectedTheme"
barStartKey="myStart"
@@ -46,12 +46,12 @@ export default {
data() {
return {
chartStart: '2020-03-02 00:00',
- chartEnd: '2020-03-04 00:00',
+ chartEnd: '2020-03-05 10:00',
pushOnOverlap: true,
isMagnetic: true,
grid: true,
rowHeight: 40,
- rowLabelWidth: 15,
+ rowLabelWidth: '200px',
hideTimeaxis: false,
highlightOnHover: false,
hours: [...Array(24).keys()],
@@ -166,7 +166,7 @@ export default {
color: 'white',
backgroundColor: '#5effad',
pushOnOverlap: false,
- zIndex: 3,
+ zIndex: 2,
},
},
{
@@ -213,8 +213,8 @@ export default {
methods: {
onDragend(e) {
- let {event, bar} = e
- console.log('onDragend', {event: event.type, bar})
+ let { event, bar } = e
+ console.log('onDragend', { event: event.type, bar })
},
},
}