|
@@ -101,6 +101,7 @@ const initChart = () => {
|
|
|
// color: item.color || "#00FF00", // Default color
|
|
|
},
|
|
|
data: item.data,
|
|
|
+ animation: false
|
|
|
})),
|
|
|
};
|
|
|
myChart.setOption(option,true);
|
|
@@ -118,21 +119,25 @@ const saveChartAndSend = async () => {
|
|
|
tempChart.setOption(option);
|
|
|
|
|
|
// 设置导出时坐标轴样式为黑色
|
|
|
- tempChart.setOption({
|
|
|
- xAxis: {
|
|
|
+ tempChart.setOption({
|
|
|
+ xAxis: option.xAxis.map((xAxis: any) => ({
|
|
|
+ ...xAxis,
|
|
|
axisLine: { lineStyle: { color: "#000000" } },
|
|
|
axisLabel: { color: "#000000" }
|
|
|
- },
|
|
|
- yAxis: {
|
|
|
+ })),
|
|
|
+ yAxis: option.yAxis.map((yAxis: any) => ({
|
|
|
+ ...yAxis,
|
|
|
axisLine: { lineStyle: { color: "#000000" } },
|
|
|
axisLabel: { color: "#000000" }
|
|
|
- }
|
|
|
+ })),
|
|
|
+ series: option.series
|
|
|
});
|
|
|
+console.log(tempChart.getOption());
|
|
|
|
|
|
// 导出图表
|
|
|
const imgData = await tempChart.getDataURL({
|
|
|
type: 'png',
|
|
|
- pixelRatio: 1,
|
|
|
+ pixelRatio: 2,
|
|
|
backgroundColor: '#fff'
|
|
|
});
|
|
|
|