update
This commit is contained in:
@@ -64,7 +64,22 @@ const EnergyCostChart = (props) => {
|
||||
</div>
|
||||
|
||||
<div className="flex-1" style={{ marginTop: "8px" }}>
|
||||
<ReactECharts option={options} style={{ height: "180px" }} />
|
||||
{options && (
|
||||
<ReactECharts option={options} style={{ height: "180px" }} />
|
||||
)}
|
||||
{!options && (
|
||||
<p
|
||||
style={{
|
||||
color: "#cccf",
|
||||
fontSize: "20px",
|
||||
userSelect: "none",
|
||||
textAlign: "center",
|
||||
paddingTop: "32px",
|
||||
}}
|
||||
>
|
||||
暂无数据
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
@@ -73,6 +88,7 @@ const EnergyCostChart = (props) => {
|
||||
export default EnergyCostChart;
|
||||
|
||||
function getOptions(period, source, trend) {
|
||||
if (trend[period].length == 0) return null;
|
||||
return {
|
||||
color: ["#FFD160", "#12FFF5", "#2760FF"],
|
||||
grid: { top: 32, right: 12, bottom: 56, left: 48 },
|
||||
|
||||
Reference in New Issue
Block a user