调整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" />
<!-- 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. 总分分数段图表 -->
<CjZfFs :dj-rs-list="djRsList" />

View File

@ -35,10 +35,12 @@ interface BjPjInfo {
// --- Props ---
interface Props {
bjPjList?: BjPjInfo[];
currentBjId?: string | number;
}
const props = withDefaults(defineProps<Props>(), {
bjPjList: () => [],
currentBjId: "",
});
// --- Emits ---
@ -73,13 +75,22 @@ const drawLineChart = () => {
// 使
const lineData = {
categories: props.bjPjList.map(
(bj) => bj.bjmc || bj.njmc + bj.bjmc
),
categories: props.bjPjList.map((bj) => {
const label = bj.bjmc || bj.njmc + bj.bjmc;
return label;
}),
series: [
{
name: "班级平均分",
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.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);
try {

View File

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