com.vaadin.flow.component.charts.model.LegendNavigation Maven / Gradle / Ivy
/**
* 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;
import com.vaadin.flow.component.charts.model.style.Style;
/**
* Options for the paging or navigation appearing when the legend is overflown.
* Navigation works well on screen, but not in static exported images. One way
* of working around that is to increase the chart height in export.
*/
public class LegendNavigation extends AbstractConfigurationObject {
private Color activeColor;
private Boolean animation;
private Number arrowSize;
private Boolean enabled;
private Color inactiveColor;
private Style style;
public LegendNavigation() {
}
/**
* @see #setActiveColor(Color)
*/
public Color getActiveColor() {
return activeColor;
}
/**
* The color for the active up or down arrow in the legend page navigation.
*
* Defaults to: #003399
*/
public void setActiveColor(Color activeColor) {
this.activeColor = activeColor;
}
/**
* @see #setAnimation(Boolean)
*/
public Boolean getAnimation() {
return animation;
}
/**
* How to animate the pages when navigating up or down. A value of
* true
applies the default navigation given in the
* chart.animation option. Additional options can be given as an object
* containing values for easing and duration. .
*
* Defaults to: true
*/
public void setAnimation(Boolean animation) {
this.animation = animation;
}
/**
* @see #setArrowSize(Number)
*/
public Number getArrowSize() {
return arrowSize;
}
/**
* The pixel size of the up and down arrows in the legend paging navigation.
* .
*
* Defaults to: 12
*/
public void setArrowSize(Number arrowSize) {
this.arrowSize = arrowSize;
}
public LegendNavigation(Boolean enabled) {
this.enabled = enabled;
}
/**
* @see #setEnabled(Boolean)
*/
public Boolean getEnabled() {
return enabled;
}
/**
*
* Whether to enable the legend navigation. In most cases, disabling the
* navigation results in an unwanted overflow.
*
*
*
* See also the adapt chart to legend plugin for a solution to extend the chart
* height to make room for the legend, optionally in exported charts only.
*
*
* Defaults to: true
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
* @see #setInactiveColor(Color)
*/
public Color getInactiveColor() {
return inactiveColor;
}
/**
* The color of the inactive up or down arrow in the legend page navigation.
* .
*
* Defaults to: #cccccc
*/
public void setInactiveColor(Color inactiveColor) {
this.inactiveColor = inactiveColor;
}
/**
* @see #setStyle(Style)
*/
public Style getStyle() {
if (style == null) {
style = new Style();
}
return style;
}
/**
* Text styles for the legend page navigation.
*/
public void setStyle(Style style) {
this.style = style;
}
}