be.ceau.chart.dataset.BubbleDataset Maven / Gradle / Ivy
Show all versions of chart Show documentation
/*
Copyright 2018 Marceau Dewilde
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package be.ceau.chart.dataset;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import be.ceau.chart.color.Color;
import be.ceau.chart.datapoint.BubbleDataPoint;
import be.ceau.chart.objects.OptionalArray;
/**
*
* A collection of data points for a bubble chart.
*
*
*
* For best results, ensure that each property is set with a list of equal
* length.
*
*
*/
@JsonInclude(Include.NON_EMPTY)
@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
public class BubbleDataset extends RoundDataset {
/**
* @see #setHoverRadius(List)
*/
private final List hoverRadius = new OptionalArray();
/**
*
* The fill color of the bubbles.
*
*
*
* Each BubbleDataPoint in this BubbleDataset uses the backgroundColor at
* its corresponding index.
*
*/
public BubbleDataset setBackgroundColor(List backgroundColor) {
return super.setBackgroundColor(backgroundColor);
}
/**
*
* The stroke color of the bubbles.
*
*
*
* Each BubbleDataPoint in this BubbleDataset uses the borderColor at its
* corresponding index.
*
*/
public BubbleDataset setBorderColor(List borderColor) {
return super.setBorderColor(borderColor);
}
/**
*
* The stroke width of bubble in pixels.
*
*
*
* Each BubbleDataPoint in this BubbleDataset uses the borderWidth at the
* its corresponding index.
*
*/
public BubbleDataset setBorderWidth(List borderWidth) {
return super.setBorderWidth(borderWidth);
}
/**
*
* The fill color of the bubbles when hovered.
*
*
*
* Each BubbleDataPoint in this BubbleDataset uses the hoverBackgroundColor
* at its corresponding index.
*
*/
public BubbleDataset setHoverBackgroundColor(List hoverBackgroundColor) {
return super.setHoverBackgroundColor(hoverBackgroundColor);
}
/**
*
* The stroke color of the bubbles when hovered.
*
*
*
* Each BubbleDataPoint in this BubbleDataset uses the hoverBorderColor at
* its corresponding index.
*
*/
public BubbleDataset setHoverBorderColor(List hoverBorderColor) {
return super.setHoverBorderColor(hoverBorderColor);
}
/**
*
* The stroke width of the bubbles when hovered.
*
*
*
* Each BubbleDataPoint in this BubbleDataset uses the hoverBorderWidth at
* its corresponding index.
*
*/
public BubbleDataset setHoverBorderWidth(List hoverBorderWidth) {
return super.setHoverBorderWidth(hoverBorderWidth);
}
/**
*
* Additional radius to add to data radius on hover.
*
*
*
* Each BubbleDataPoint in this BubbleDataset uses the hoverRadius at its
* corresponding index.
*
*/
public BubbleDataset setHoverRadius(List hoverRadius) {
this.hoverRadius.clear();
if (hoverRadius != null) {
this.hoverRadius.addAll(hoverRadius);
}
return this;
}
/**
* @see BubbleDataset#setHoverRadius(List)
*/
public BubbleDataset addHoverRadius(Integer hoverRadius) {
this.hoverRadius.add(hoverRadius);
return this;
}
}