-
-
Notifications
You must be signed in to change notification settings - Fork 247
/
Copy pathoh-calendar-axis.js
35 lines (32 loc) · 1.36 KB
/
oh-calendar-axis.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
export default {
get (component, startTime, endTime, chart, orient) {
let calendar = Object.assign({}, component.config)
calendar.range = [startTime.toDate(), endTime.subtract(1, 'day').toDate()]
if (orient) calendar.orient = orient
calendar.dayLabel = {
firstDay: 1,
margin: 5
}
calendar.monthName = {
margin: 5
}
if (!calendar.top) calendar.top = 100
if (!calendar.bottom) calendar.bottom = 50
if (!calendar.left) calendar.left = 60
if (!calendar.right) calendar.right = 50
if (document && document.documentElement.classList.contains('theme-dark')) {
if (!calendar.itemStyle) calendar.itemStyle = {}
if (!calendar.itemStyle.color) calendar.itemStyle.color = '#333'
if (!calendar.itemStyle.borderColor) calendar.itemStyle.borderColor = '#555'
if (!calendar.itemStyle) calendar.itemStyle = {}
if (!calendar.dayLabel) calendar.dayLabel = {}
if (!calendar.dayLabel.color) calendar.dayLabel.color = '#aaa'
if (!calendar.monthLabel) calendar.monthLabel = {}
if (!calendar.monthLabel.color) calendar.monthLabel.color = '#aaa'
if (!calendar.splitLine) calendar.splitLine = {}
if (!calendar.splitLine.lineStyle) calendar.splitLine.lineStyle = {}
if (!calendar.splitLine.lineStyle.color) calendar.splitLine.lineStyle.color = '#aaa'
}
return calendar
}
}