fix line config

This commit is contained in:
Qiuxia Fan 2022-03-18 11:43:13 +08:00
parent c1bd2950ee
commit d01631ef04
6 changed files with 39 additions and 5 deletions

View File

@ -106,6 +106,8 @@ const msg = {
no: "No",
tableHeaderCol1: "Name of the first column of the table",
tableHeaderCol2: "Name of the second column of the table",
showXAxis: "Show X Axis",
showYAxis: "Show Y Axis",
hourTip: "Select Hour",
minuteTip: "Select Minute",
secondTip: "Select Second",

View File

@ -106,6 +106,8 @@ const msg = {
no: "否",
tableHeaderCol1: "表格的第一列的名称",
tableHeaderCol2: "表格的第二列的名称",
showXAxis: "显示X轴",
showYAxis: "显示Y轴",
hourTip: "选择小时",
minuteTip: "选择分钟",
secondTip: "选择秒数",

View File

@ -31,7 +31,13 @@ limitations under the License. -->
:is="dashboardStore.selectedGrid.graph.type"
:intervalTime="appStoreWithOut.intervalTime"
:data="states.source"
:config="dashboardStore.selectedGrid"
:config="{
...dashboardStore.selectedGrid.graph,
i: dashboardStore.selectedGrid.i,
metrics: dashboardStore.selectedGrid.metrics,
metricTypes: dashboardStore.selectedGrid.metricTypes,
standard: dashboardStore.selectedGrid.standard,
}"
/>
<div v-show="!dashboardStore.selectedGrid.graph.type" class="no-data">
{{ t("noData") }}

View File

@ -13,6 +13,24 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<div>
<span class="label">{{ t("showXAxis") }}</span>
<el-switch
v-model="selectedGrid.graph.showXAxis"
active-text="Yes"
inactive-text="No"
@change="updateConfig({ showXAxis: selectedGrid.graph.showXAxis })"
/>
</div>
<div>
<span class="label">{{ t("showYAxis") }}</span>
<el-switch
v-model="selectedGrid.graph.showYAxis"
active-text="Yes"
inactive-text="No"
@change="updateConfig({ showYAxis: selectedGrid.graph.showYAxis })"
/>
</div>
<div>
<span class="label">{{ t("smooth") }}</span>
<el-switch

View File

@ -87,11 +87,15 @@ export const DefaultGraphConfig: { [key: string]: any } = {
type: "EndpointList",
dashboardName: "",
fontSize: 12,
showXAxis: false,
showYAxis: false,
},
ServiceList: {
type: "ServiceList",
dashboardName: "",
fontSize: 12,
showXAxis: false,
showYAxis: false,
},
HeatMap: {
type: "HeatMap",

View File

@ -37,6 +37,8 @@ const props = defineProps({
smooth: false,
showSymbol: false,
opacity: 0.4,
showXAxis: true,
showYAxis: true,
}),
},
});
@ -76,11 +78,11 @@ function getOption() {
]),
name: i,
type: "line",
symbol: "none",
symbol: "circle",
barMaxWidth: 10,
step: props.config.step,
smooth: props.config.smooth,
showSymbol: true,
showSymbol: props.config.showSymbol,
lineStyle: {
width: 1.5,
type: "solid",
@ -173,7 +175,7 @@ function getOption() {
},
xAxis: {
type: "category",
show: true,
show: props.config.showXAxis,
axisTick: {
lineStyle: { color: "#c1c5ca41" },
alignWithLabel: true,
@ -190,7 +192,7 @@ function getOption() {
axisLabel: {
color: "#9da5b2",
fontSize: "11",
show: true,
show: props.config.showYAxis,
},
},
series: temp,