com.github.abel533.echarts.data.AxisData 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.data;
import com.github.abel533.echarts.style.TextStyle;
import java.io.Serializable;
/**
* 自定义样式的数据 - 适用于axis.data
*
* @author liuzh
*/
public class AxisData implements Serializable {
private static final long serialVersionUID = -6515942952591477027L;
/**
* 值
*/
private Object value;
/**
* 特殊样式
*
* @see com.github.abel533.echarts.style.TextStyle
*/
private TextStyle textStyle;
/**
* 构造函数,参数:value
*
* @param value
*/
public AxisData(Object value) {
this.value = value;
}
/**
* 构造函数,参数:value,textStyle
*
* @param value
* @param textStyle
*/
public AxisData(Object value, TextStyle textStyle) {
this.value = value;
this.textStyle = textStyle;
}
/**
* 获取value值
*/
public Object value() {
return this.value;
}
/**
* 设置value值
*
* @param value
*/
public AxisData value(Object value) {
this.value = value;
return this;
}
/**
* 获取textStyle值
*/
public TextStyle textStyle() {
if (this.textStyle == null) {
this.textStyle = new TextStyle();
}
return this.textStyle;
}
/**
* 设置textStyle值
*
* @param textStyle
*/
public AxisData textStyle(TextStyle textStyle) {
this.textStyle = textStyle;
return this;
}
/**
* 获取value值
*/
public Object getValue() {
return value;
}
/**
* 设置value值
*
* @param value
*/
public void setValue(Object value) {
this.value = value;
}
/**
* 获取textStyle值
*/
public TextStyle getTextStyle() {
return textStyle;
}
/**
* 设置textStyle值
*
* @param textStyle
*/
public void setTextStyle(TextStyle textStyle) {
this.textStyle = textStyle;
}
}