fix rest day style in chart
This commit is contained in:
@@ -29,14 +29,14 @@ const props = defineProps<{
|
||||
const dateTextList = computed(() => props.dateTextList);
|
||||
const { restDaySet } = useRestDayCalendar(dateTextList);
|
||||
|
||||
function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
function buildOption(visibleDateTextList: string[], chartWidth: number): EChartsOption {
|
||||
const labelList = visibleDateTextList.map(item => item.slice(5));
|
||||
return {
|
||||
...buildAxisChartOption(labelList),
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: labelList,
|
||||
axisTick: { show: false },
|
||||
axisTick: { show: true, length: 0, interval: 0 },
|
||||
axisLabel: { color: "#52607a", interval: "auto", hideOverlap: true }
|
||||
},
|
||||
yAxis: [
|
||||
@@ -62,7 +62,7 @@ function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
name: "订单数",
|
||||
type: "bar",
|
||||
yAxisIndex: 0,
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, window.innerWidth - 32),
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, chartWidth),
|
||||
tooltip: { valueFormatter: value => formatQuantity(Number(value)) },
|
||||
data: visibleDateTextList.map(dateText => getNumber(getDailyItem(props.list, dateText)?.orderCount))
|
||||
},
|
||||
|
||||
@@ -29,14 +29,14 @@ const props = defineProps<{
|
||||
const dateTextList = computed(() => props.dateTextList);
|
||||
const { restDaySet } = useRestDayCalendar(dateTextList);
|
||||
|
||||
function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
function buildOption(visibleDateTextList: string[], chartWidth: number): EChartsOption {
|
||||
const labelList = visibleDateTextList.map(item => item.slice(5));
|
||||
return {
|
||||
...buildAxisChartOption(labelList),
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: labelList,
|
||||
axisTick: { show: false },
|
||||
axisTick: { show: true, length: 0, interval: 0 },
|
||||
axisLabel: { color: "#52607a", interval: "auto", hideOverlap: true }
|
||||
},
|
||||
series: [
|
||||
@@ -44,7 +44,7 @@ function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
name: "直接履约",
|
||||
type: "bar",
|
||||
stack: "fulfillment",
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, window.innerWidth - 32),
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, chartWidth),
|
||||
data: visibleDateTextList.map(dateText => getNumber(getDailyItem(props.list, dateText)?.directBaseQuantity))
|
||||
},
|
||||
{
|
||||
|
||||
@@ -29,14 +29,14 @@ const props = defineProps<{
|
||||
const dateTextList = computed(() => props.dateTextList);
|
||||
const { restDaySet } = useRestDayCalendar(dateTextList);
|
||||
|
||||
function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
function buildOption(visibleDateTextList: string[], chartWidth: number): EChartsOption {
|
||||
const labelList = visibleDateTextList.map(item => item.slice(5));
|
||||
return {
|
||||
...buildAxisChartOption(labelList),
|
||||
xAxis: {
|
||||
type: "category",
|
||||
data: labelList,
|
||||
axisTick: { show: false },
|
||||
axisTick: { show: true, length: 0, interval: 0 },
|
||||
axisLabel: { color: "#52607a", interval: "auto", hideOverlap: true }
|
||||
},
|
||||
yAxis: [
|
||||
@@ -62,7 +62,7 @@ function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
type: "bar",
|
||||
stack: "quantity",
|
||||
yAxisIndex: 0,
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, window.innerWidth - 32),
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, chartWidth),
|
||||
data: visibleDateTextList.map(dateText => getNumber(getDailyItem(props.list, dateText)?.directBaseQuantity))
|
||||
},
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ const props = defineProps<{
|
||||
const dateTextList = computed(() => props.dateTextList);
|
||||
const { restDaySet } = useRestDayCalendar(dateTextList);
|
||||
|
||||
function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
function buildOption(visibleDateTextList: string[], chartWidth: number): EChartsOption {
|
||||
const labelList = visibleDateTextList.map(item => item.slice(5));
|
||||
return {
|
||||
...buildAxisChartOption(labelList),
|
||||
@@ -37,7 +37,7 @@ function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
type: "category",
|
||||
data: labelList,
|
||||
axisLine: { onZero: true },
|
||||
axisTick: { show: false },
|
||||
axisTick: { show: true, length: 0, interval: 0 },
|
||||
axisLabel: { color: "#52607a", interval: "auto", hideOverlap: true }
|
||||
},
|
||||
series: [
|
||||
@@ -45,7 +45,7 @@ function buildOption(visibleDateTextList: string[]): EChartsOption {
|
||||
name: "入库",
|
||||
type: "bar",
|
||||
stack: "stock-movement",
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, window.innerWidth - 32),
|
||||
markArea: buildRestDayMarkArea(visibleDateTextList, restDaySet.value, chartWidth),
|
||||
data: visibleDateTextList.map(dateText => Math.abs(getNumber(getDailyItem(props.list, dateText)?.inQuantity)))
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user