This commit is contained in:
lb
2024-01-02 14:33:21 +08:00
parent 4b043214ca
commit a32e6fb591
14 changed files with 261 additions and 86 deletions

View File

@@ -82,7 +82,20 @@ const SmokeTrendChart = (props) => {
</Radio.Button>
</Radio.Group>
</div>
<ReactECharts option={options} style={{ height: "240px" }} />
{options && <ReactECharts option={options} style={{ height: "240px" }} />}
{!options && (
<p
style={{
color: "#cccf",
fontSize: "24px",
userSelect: "none",
textAlign: "center",
paddingTop: "96px",
}}
>
暂无数据
</p>
)}
</div>
);
};
@@ -90,6 +103,7 @@ const SmokeTrendChart = (props) => {
export default SmokeTrendChart;
function getOptions(source, period, trend) {
if (trend[source].length === 0) return null;
return {
color: ["#FFD160", "#12FFF5", "#2760FF"],
grid: { top: 38, right: 12, bottom: 20, left: 48 },