software.xdev.chartjs.model.options.elements.Point Maven / Gradle / Ivy
/*
* Copyright © 2023 XDEV Software (https://xdev.software)
*
* 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 software.xdev.chartjs.model.options.elements;
import software.xdev.chartjs.model.enums.PointStyle;
/**
*
* Point elements are used to represent the points in a line chart or a bubble chart.
*
*
* When set, these options apply to all objects of that type unless specifically overridden by the configuration
* attached to a dataset.
*
*/
public class Point
{
protected Integer radius;
protected PointStyle pointStyle;
protected Object backgroundColor;
protected Integer borderWidth;
protected Object borderColor;
protected Integer hitRadius;
protected Integer hoverRadius;
protected Integer hoverBorderWidth;
/**
* @see #setRadius(Integer)
*/
public Integer getRadius()
{
return this.radius;
}
/**
*
* Default point radius
*
*
*
* Default {@code 3}
*
*/
public Point setRadius(final Integer radius)
{
this.radius = radius;
return this;
}
/**
* @see #setPointStyle(PointStyle)
*/
public PointStyle getPointStyle()
{
return this.pointStyle;
}
/**
*
* Default point style
*
*
*
* Default {@code 'circle'}
*
*/
public Point setPointStyle(final PointStyle pointStyle)
{
this.pointStyle = pointStyle;
return this;
}
/**
* @see #setBackgroundColor(Object)
*/
public Object getBackgroundColor()
{
return this.backgroundColor;
}
/**
*
* Default point fill color
*
*
*
* Default {@code 'rgba(0,0,0,0.1)'}
*
*/
public Point setBackgroundColor(final Object backgroundColor)
{
this.backgroundColor = backgroundColor;
return this;
}
/**
* @see #setBorderWidth(Integer)
*/
public Integer getBorderWidth()
{
return this.borderWidth;
}
/**
*
* Default point stroke width
*
*
*
* Default {@code 1}
*
*/
public Point setBorderWidth(final Integer borderWidth)
{
this.borderWidth = borderWidth;
return this;
}
/**
* @see #setBorderColor(Object)
*/
public Object getBorderColor()
{
return this.borderColor;
}
/**
*
* Default point stroke color
*
*
*
* Default {@code 'rgba(0,0,0,0.1)'}
*
*/
public Point setBorderColor(final Object borderColor)
{
this.borderColor = borderColor;
return this;
}
/**
* @see #setHitRadius(Integer)
*/
public Integer getHitRadius()
{
return this.hitRadius;
}
/**
*
* Extra radius added to point radius for hit detection
*
*
*
* Default {@code 1}
*
*/
public Point setHitRadius(final Integer hitRadius)
{
this.hitRadius = hitRadius;
return this;
}
/**
* @see #setHoverRadius(Integer)
*/
public Integer getHoverRadius()
{
return this.hoverRadius;
}
/**
*
* Default point radius when hovered
*
*
*
* Default {@code 4}
*
*/
public Point setHoverRadius(final Integer hoverRadius)
{
this.hoverRadius = hoverRadius;
return this;
}
/**
* @see #setHoverBorderWidth(Integer)
*/
public Integer getHoverBorderWidth()
{
return this.hoverBorderWidth;
}
/**
*
* Default stroke width when hovered
*
*
*
* Default {@code 1}
*
*/
public Point setHoverBorderWidth(final Integer hoverBorderWidth)
{
this.hoverBorderWidth = hoverBorderWidth;
return this;
}
}