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

com.vaadin.flow.component.charts.model.ItemPartialFill Maven / Gradle / Ivy

There is a newer version: 24.5.4
Show newest version
/**
 * Copyright 2000-2024 Vaadin Ltd.
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See {@literal } for the full
 * license.
 */
package com.vaadin.flow.component.charts.model;

import com.vaadin.flow.component.charts.model.style.Color;

/**
 * PartialFill configuration object to be used in {@link DataSeriesItemXrange}.
 * Typically used to visualize how much of a task is performed.
 */
public class ItemPartialFill extends AbstractConfigurationObject {

    private Color fill;
    private Number amount;

    /**
     * Creates an empty PartialFill configuration object
     */
    public ItemPartialFill() {

    }

    /**
     * Creates a new PartialFill with the defined fill amount
     *
     * @param amount
     *            The amount of the xrange point to be filled.
     */
    public ItemPartialFill(Number amount) {
        this.amount = amount;
    }

    /**
     * Creates a new PartialFill with the defined fill color and amount
     *
     * @param amount
     *            The amount of the xrange point to be filled.
     * @param fill
     *            The color to be used for partial fills
     */
    public ItemPartialFill(Number amount, Color fill) {
        this(amount);
        this.fill = fill;
    }

    /**
     * @see #setFill(Color)
     *
     * @return the color used for partial fills
     */
    public Color getFill() {
        return fill;
    }

    /**
     * The fill color to be used for partial fills. When null, a
     * darker shade of the point's color is used.
     *
     * @param fill
     *            color to be used for partial fills
     */
    public void setFill(Color fill) {
        this.fill = fill;
    }

    /**
     * @see #setAmount(Number)
     *
     * @return the amount used for partial fill
     */
    public Number getAmount() {
        return amount;
    }

    /**
     * The amount of the xrange point to be filled. Values can be 0-1 and are
     * converted to percentages in the default data label formatter.
     *
     * @param amount
     */
    public void setAmount(Number amount) {
        this.amount = amount;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy