Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* 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.data;
import com.github.abel533.echarts.code.MarkType;
import com.github.abel533.echarts.code.Symbol;
import com.github.abel533.echarts.style.ItemStyle;
import com.github.abel533.echarts.style.TextStyle;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Description: BasicData
*
* @author liuzh
*/
public abstract class BasicData implements Serializable {
private static final long serialVersionUID = 3510060011221090087L;
private String name;
private String text;
private Object value;
/**
* 饼图、雷达图、力导、和弦图使用x,y
*/
private Object x;
private Object y;
/**
* 在存在直角坐标系的图表如折线、柱形、K线、散点图中
* 除了通过直接指定位置外,如果希望标注基于直角系的定位,可以通过xAxis,yAxis
*/
private Integer xAxis;
private Integer yAxis;
private MarkType type;
private Object symbol;
private Object symbolSize;
private ItemStyle itemStyle;
/**
* 特殊样式
*
* @see com.github.abel533.echarts.style.TextStyle
*/
private TextStyle textStyle;
/**
* 构造函数
*/
public BasicData() {
}
/**
* 构造函数,参数:name
*
* @param name
*/
protected BasicData(String name) {
this.name = name;
}
/**
* 构造函数,参数:name,value
*
* @param name
* @param value
*/
public BasicData(String name, Object value) {
this.name = name;
this.value = value;
}
/**
* 构造函数,参数:name,symbol,symbolSize
*
* @param name
* @param symbol
* @param symbolSize
*/
public BasicData(String name, Object symbol, Object symbolSize) {
this.name = name;
this.symbol = symbol;
this.symbolSize = symbolSize;
}
/**
* 构造函数,参数:value,symbol
*
* @param value
* @param symbol
*/
public BasicData(Object value, Object symbol) {
this.value = value;
this.symbol = symbol;
}
/**
* 构造函数,参数:value,symbol,symbolSize
*
* @param value
* @param symbol
* @param symbolSize
*/
public BasicData(Object value, Object symbol, Object symbolSize) {
this.value = value;
this.symbol = symbol;
this.symbolSize = symbolSize;
}
/**
* 获取textStyle值
*/
public TextStyle textStyle() {
if (this.textStyle == null) {
this.textStyle = new TextStyle();
}
return this.textStyle;
}
/**
* 设置textStyle值
*
* @param textStyle
*/
public T textStyle(TextStyle textStyle) {
this.textStyle = textStyle;
return (T) this;
}
/**
* 获取text值
*/
public String text() {
return this.text;
}
/**
* 设置text值
*
* @param text
*/
public T text(String text) {
this.text = text;
return (T) this;
}
/**
* 获取name值
*/
public String name() {
return this.name;
}
/**
* 设置name值
*
* @param name
*/
public T name(String name) {
this.name = name;
return (T) this;
}
/**
* 获取value值
*/
public Object value() {
return this.value;
}
/**
* 设置value值
*
* @param value
*/
public T value(Object value) {
this.value = value;
return (T) this;
}
/**
* 设置value值
*
* @param values
*/
public T value(Object... values) {
if (values == null || values.length == 0) {
return (T) this;
}
if (this.value == null) {
this.value = new ArrayList