com.vaadin.flow.component.charts.model.WaterFallSum Maven / Gradle / Ivy
package com.vaadin.flow.component.charts.model;
/*-
* #%L
* Vaadin Charts for Flow
* %%
* Copyright (C) 2014 - 2020 Vaadin Ltd
* %%
* This program is available under Commercial Vaadin Developer License
* 4.0 (CVDLv4).
*
* For the full License, see .
* #L%
*/
/**
* DataSeriesItem that can be used as sum or intermediate sum in waterfall
* charts. Note that sums don't support all standard point features and their
* value don't need be be set (automatically calculated).
*/
public class WaterFallSum extends DataSeriesItem {
@SuppressWarnings("unused")
private Boolean isSum = Boolean.TRUE;
private Boolean isIntermediateSum;
public WaterFallSum(String name) {
setName(name);
}
/**
* @param intermediate
* true if the sum is should be intermediate
*/
public void setIntermediate(boolean intermediate) {
if (intermediate) {
isIntermediateSum = Boolean.TRUE;
isSum = null;
} else {
isIntermediateSum = null;
isSum = Boolean.TRUE;
}
}
public boolean isIntermediate() {
return isIntermediateSum != null;
}
}