调整echarts

This commit is contained in:
ywyonui 2025-07-30 13:45:52 +08:00
parent 67ab505da5
commit f32e8f5a5f
4 changed files with 5179 additions and 2164 deletions

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,11 @@
<CjBjTjGl :tjgl-data="tjglData" /> <CjBjTjGl :tjgl-data="tjglData" />
<!-- 6. 本班与年级平均分对比分析图表 --> <!-- 6. 本班与年级平均分对比分析图表 -->
<CjBjNjPjf v-model:selected-km-id="xzkmId" :bj-pj-list="bjPjList" /> <CjBjNjPjf
v-model:selected-km-id="xzkmId"
:bj-pj-list="bjPjList"
:current-bj-id="xzbjId"
/>
<!-- 7. 总分分数段图表 --> <!-- 7. 总分分数段图表 -->
<CjZfFs :dj-rs-list="djRsList" /> <CjZfFs :dj-rs-list="djRsList" />

View File

@ -35,10 +35,12 @@ interface BjPjInfo {
// --- Props --- // --- Props ---
interface Props { interface Props {
bjPjList?: BjPjInfo[]; bjPjList?: BjPjInfo[];
currentBjId?: string | number;
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
bjPjList: () => [], bjPjList: () => [],
currentBjId: "",
}); });
// --- Emits --- // --- Emits ---
@ -73,13 +75,22 @@ const drawLineChart = () => {
// 使 // 使
const lineData = { const lineData = {
categories: props.bjPjList.map( categories: props.bjPjList.map((bj) => {
(bj) => bj.bjmc || bj.njmc + bj.bjmc const label = bj.bjmc || bj.njmc + bj.bjmc;
), return label;
}),
series: [ series: [
{ {
name: "班级平均分", name: "班级平均分",
data: props.bjPjList.map((bj) => bj.fs), data: props.bjPjList.map((bj) => bj.fs),
color: ["#ea7ccc"],
textColorFormatter: (item: any, index: number, opts: any) => {
const bj = props.bjPjList[index];
if (bj && bj.bjId === props.currentBjId) {
return "#1890ff"; // 使
}
return "#666666"; // 使
},
}, },
], ],
}; };
@ -118,6 +129,35 @@ const drawLineChart = () => {
newOption.categories = lineData.categories; newOption.categories = lineData.categories;
newOption.series = lineData.series; newOption.series = lineData.series;
// x
newOption.xAxis.labelColorFormatter = (
item: string,
index: number,
opts: any
) => {
const bj = props.bjPjList[index];
if (bj && bj.bjId === props.currentBjId) {
return "#1890ff"; // 使
}
return "#666666"; // 使
};
// x
newOption.dataLabelColorFormatter = (
item: any,
index: number,
opts: any
) => {
const bj = props.bjPjList[index];
if (bj && bj.bjId === props.currentBjId) {
return "#1890ff"; // 使
}
return "#666666"; // 使
};
//
newOption.color = ["#000000"]; // 线
const options = new uCharts(newOption); const options = new uCharts(newOption);
try { try {

View File

@ -250,14 +250,14 @@ export const lineOption = {
rotateLock: false, rotateLock: false,
background: "#FFFFFF", background: "#FFFFFF",
color: [ color: [
"#1890FF", // "#1890FF",
"#91CB74", // "#91CB74",
"#FAC858", // "#FAC858",
"#EE6666", // "#EE6666",
"#73C0DE", // "#73C0DE",
"#3CA272", // "#3CA272",
"#FC8452", // "#FC8452",
"#9A60B4", // "#9A60B4",
"#ea7ccc", "#ea7ccc",
], ],
padding: [15, 10, 0, 15], padding: [15, 10, 0, 15],