All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.abel533.echarts.Option Maven / Gradle / Ivy

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014-2015 [email protected]
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.github.abel533.echarts;

import com.github.abel533.echarts.axis.Axis;
import com.github.abel533.echarts.code.Easing;
import com.github.abel533.echarts.code.Symbol;
import com.github.abel533.echarts.code.Trigger;
import com.github.abel533.echarts.option.NoDataLoadingOption;
import com.github.abel533.echarts.series.Parallel;
import com.github.abel533.echarts.series.Series;
import com.github.abel533.echarts.style.ItemStyle;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

/**
 * Description: Option
 *
 * @author liuzh
 */
@Getter
@Setter
public class Option implements Serializable {

    private static final long serialVersionUID = 4664955083296866542L;

    /**
     * 全图默认背景,(详见backgroundColor),默认为无,透明
     */
    private Object backgroundColor;
    /**
     * 数值系列的颜色列表,(详见color),可配数组,eg:['#87cefa', 'rgba(123,123,123,0.5)','...'],当系列数量个数比颜色列表长度大时将循环选取
     */
    private List color;
    /**
     * 非IE8-支持渲染为图片,(详见renderAsImage)
     * {boolean | string} false,非IE8-支持渲染为图片,可设为true或指定图片格式(png | jpeg),渲染为图片后实例依然可用(如setOption,resize等),但各种交互失效
     */
    private Object renderAsImage;
    /**
     * 是否启用拖拽重计算特性,默认关闭,(详见calculable,相关的还有 calculableColor, calculableHolderColor, nameConnector, valueConnector)
     */
    private Boolean calculable;
    /**
     * 是否启用图表初始化动画,默认开启,建议IE8-关闭,(详见 animation,相关的还有 addDataAnimation, animationThreshold, animationDuration, animationEasing)
     */
    private Boolean animation;
    /**
     * 时间轴(详见timeline),每个图表最多仅有一个时间轴控件
     */
    private Timeline timeline;
    /**
     * 标题(详见title),每个图表最多仅有一个标题控件
     */
    private Title title;
    /**
     * 工具箱(详见toolbox),每个图表最多仅有一个工具箱
     */
    private Toolbox toolbox;
    /**
     * 提示框(详见tooltip),鼠标悬浮交互时的信息提示
     */
    private Tooltip tooltip;
    /**
     * 图例(详见legend),每个图表最多仅有一个图例,混搭图表共享
     */
    private Legend legend;
    /**
     * 值域选择(详见dataRange),值域范围
     */
    private DataRange dataRange;
    /**
     * 数据区域缩放(详见dataZoom),数据展现范围选择
     */
    private List dataZoom;
    /**
     * 缩放漫游组件(详见RoamController),数据缩放漫游选择
     */
    private RoamController roamController;
    /**
     * 直角坐标系内绘图网格(详见grid)
     */
    private Grid grid;
    /**
     * 直角坐标系中横轴数组(详见xAxis),数组中每一项代表一条横轴坐标轴,标准(1.0)中规定最多同时存在2条横轴
     */
    private List xAxis;
    /**
     * 直角坐标系中纵轴数组(详见yAxis),数组中每一项代表一条纵轴坐标轴,标准(1.0)中规定最多同时存在2条纵轴
     */
    private List yAxis;
    /**
     * 驱动图表生成的数据内容(详见series),数组中每一项代表一个系列的特殊选项及数据
     */
    private List series;
    /**
     * 极坐标
     */
    private List polar;
    /**
     * 默认标志图形类型列表,循环使用
     */
    private List symbolList;
    /**
     * 拖拽重计算提示边框颜色
     */
    private String calculableColor;
    /**
     * 可计算占位提示颜色,默认值 '#ccc'
     */
    private String calculableHolderColo;
    /**
     * 数据合并名字间连接符,默认值'&'
     */
    private String nameConnector;
    /**
     * 数据合并名字与数值间连接符,默认值 ':'
     */
    private String valueConnector;
    /**
     * 是否启用动态数据接口动画效果,默认开启,建议IE8-关闭
     */
    private Boolean addDataAnimation;
    /**
     * 动画元素阀值,产生的图形原素超过2000不出动画,默认开启,建议IE8-关闭
     */
    private Integer animationThreshold;
    /**
     * 进入动画时长,单位ms
     */
    private Integer animationDuration;
    /**
     * 更新动画时长,单位ms
     */
    private Integer animationDurationUpdate;
    /**
     * 主元素的缓动效果
     */
    private Easing animationEasing;
    /**
     * 数据更新动画的缓动效果
     */
    private Object animationEasingUpdate;
    /**
     * 无数据时载入配置
     */
    private NoDataLoadingOption noDataLoadingOption;
    /**
     * 当使用timeline时,每一组数据要放到单独的option中
     */
    private List