- Notifications
You must be signed in to change notification settings - Fork70
Open
Description
publicstaticvoidmain(String[]args) {Lineline =newLine() .setTitle(newTitle().setSubtext("过程质量监控系统")) .setTooltip(newTooltip() .setTrigger("axis") .setAxisPointer(newTooltipAxisPointer().setType("cross"))) .addXAxis(newCategoryAxis() .setType("category") .setBoundaryGap(false) .setData(newString[]{"HS25061101","HS25061102","HS25061103","HS25061104","HS25061105","HS25061106","HS25061107","HS25061108","HS25061109","HS25061110","HS25061111","HS25061112","HS25061113","HS25061114","HS25061115","HS25061116","HS25061117","HS25061118","HS25061119","HS25061120"}) .setAxisLabel(newValueAxis().setInterval(0)) .setAxisLabel(newValueAxisLabel().setRotate(45)) ) .addYAxis(newValueAxis() .setType("value") .setAxisLabel(newValueAxisLabel().setFormatter("{value}")) .setAxisPointer(newTooltipAxisPointer().setSnap(true))) .setVisualMap(newPiecewiseVisualMap() .setShow(false) .setDimension(0) .setPieces(newVisualPiece[]{newVisualPiece().setLte(4).setColor("green"),newVisualPiece().setGt(4).setLte(8).setColor("red"),newVisualPiece().setGt(8).setLte(11).setColor("green"),newVisualPiece().setGt(11).setLte(17).setColor("red"),newVisualPiece().setGt(17).setColor("green") }) ) .addSeries(newLineSeries() .setName("Electricity") .setType("line") .setSmooth(true) .setData(newNumber[]{7.1,7.2,6.1,8.2,6.1,6.5,7.1,7.3,9,5.2,5.5,4.3,6.2,6.5,7.2,7.5,6.3,6.4,5.5,7.1}) .setLabel(newSeriesLabel().setShow(true).setPosition("top")) .setMarkArea(newMarkArea() .setItemStyle(newItemStyle().setColor("rgba(255, 173, 177, 0.4)")) .setData(newMarkArea2DDataItem[]{newMarkArea2DDataItem() .setStartPoint(newMarkArea2DDataItemDim().setName("预警").setXAxis("HS25061105")) .setEndPoint(newMarkArea2DDataItemDim().setName("预警").setXAxis("HS25061109")),newMarkArea2DDataItem() .setStartPoint(newMarkArea2DDataItemDim().setName("预警").setXAxis("HS25061112")) .setEndPoint(newMarkArea2DDataItemDim().setName("预警").setXAxis("HS25061116")) })) .setMarkLine(newMarkLine() .setData(newMarkArea1DDataItem[]{newMarkArea1DDataItem().setYAxis(8).setName("基准线") }).setLineStyle(newLineStyle().setColor("red").setType("dotted"))) .setAnimation(false));Engineengine =newEngine();StringprojectRoot =System.getProperty("user.dir");StringoutputPath =Paths.get(projectRoot,"qms-admin","src","main","resources","templates","template2.html").toString();engine.render(outputPath,line); }
Metadata
Metadata
Assignees
Labels
No labels
