package org.icepear.echarts;

import org.icepear.echarts.charts.bar3D.Bar3DSeries;
import org.icepear.echarts.components.coord.SplitLine;
import org.icepear.echarts.components.coord.cartesian.CategoryAxis;
import org.icepear.echarts.components.coord.cartesian.ValueAxis;
import org.icepear.echarts.components.grid3D.Grid3D;
import org.icepear.echarts.components.grid3D.ViewControl;
import org.icepear.echarts.components.inRange.InRange;
import org.icepear.echarts.components.series.LineStyle;
import org.icepear.echarts.components.title.Title;
import org.icepear.echarts.components.visualMap.ContinousVisualMap;
import org.icepear.echarts.origin.util.SeriesOption;
import org.icepear.echarts.render.Engine;

/**
 * @author hongawen
 * @version 1.0.0
 * @date 2023年06月25日 14:27
 */
public class Test3DBar {
    private final static Engine ENGINE = new Engine();

    public static void main(String[] args) {
        Option option3D = new Option();
        option3D.setBackgroundColor("#fff");
        option3D.setTitle(new Title().setText("暂降密度图").setX("center"));
        option3D.setVisualMap(new ContinousVisualMap().setMax(20).setShow(false).setInRange(new InRange().setColor(new String[]{"#313695", "#00BB00", "#ff8000", "#a50026"})));
        option3D.setXAxis3D(new CategoryAxis().setName("剩余电压(%)").setData(new String[]{"0-10", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"}));
        option3D.setYAxis3D(new CategoryAxis()
                .setName("持续时间(cyc)")
                .setData(new String[]{"1cyc", "2cyc", "3cyc", "4cyc", "5cyc", "6~10cyc", "10~20cyc", "20~30cyc", "30~60cyc"})
                .setSplitLine(new SplitLine().setLineStyle(new LineStyle().setColor("#").setType("dashed").setOpacity(0.5)))
        );
        option3D.setZAxis3D(new ValueAxis().setSplitNumber(10).setMinInterval(10).setName("次数"));
        option3D.setGrid3D(new Grid3D()
                .setViewControl(new ViewControl().setBeta(8).setAlpha(5))
                .setBoxWidth(200)
                .setBoxDepth(80)
        );
        Bar3DSeries bar3DSeries = new Bar3DSeries()
                .setData(new Number[][]{{0,0,0},{0,1,0}})
                .setShading("realistic");
        option3D.setSeries(new SeriesOption[]{bar3DSeries});
        System.out.println( ENGINE.renderJsonOption(option3D));
    }
}
