public interface Controller
| Modifier and Type | Method and Description |
|---|---|
void |
addElementAndReset(ControllerContext context,
IsChart chart,
int index)
Create a single element for the data at the given index and reset its state.
|
void |
addElements(ControllerContext context,
IsChart chart)
Create elements for each piece of data in the dataset.
|
static void |
checkIfValid(Controller controller)
Checks if key passed as argument is not
null and its type is valid as well. |
void |
draw(ControllerContext context,
IsChart chart,
double ease)
Draw the representation of the dataset.
|
ControllerType |
getType()
Controller must define a unique id in order to be configurable.
Returns the controller id. |
void |
initialize(ControllerContext context,
IsChart chart,
int datasetIndex)
Initializes the controller.
|
static boolean |
isConsistent(Controller controller,
ControllerContext context,
IsChart chart)
Returns
true if all arguments are consistent. |
static boolean |
isValid(Controller controller)
Returns
true if the controller is consistent. |
void |
removeHoverStyle(ControllerContext context,
IsChart chart,
StyleElement element)
Remove hover styling from the given element.
|
void |
setHoverStyle(ControllerContext context,
IsChart chart,
StyleElement element)
Add hover styling to the given element.
|
void |
update(ControllerContext context,
IsChart chart,
boolean reset)
Update the elements in response to new data.
|
static boolean isConsistent(Controller controller, ControllerContext context, IsChart chart)
true if all arguments are consistent.controller - controller instance to checkcontext - controller context instance, should be provided by CHART.JS.chart - chart instancetrue if all arguments are consistentstatic void checkIfValid(Controller controller)
null and its type is valid as well. If not, throw a IllegalArgumentException.controller - controller instance to checkstatic boolean isValid(Controller controller)
true if the controller is consistent.controller - controller instance to checktrue if the controller is consistentControllerType getType()
void initialize(ControllerContext context, IsChart chart, int datasetIndex)
context - context of controllerchart - chart instancedatasetIndex - dataset indexvoid addElements(ControllerContext context, IsChart chart)
context - context of controllerchart - chart instancevoid addElementAndReset(ControllerContext context, IsChart chart, int index)
context - context of controllerchart - chart instanceindex - dataset indexvoid draw(ControllerContext context, IsChart chart, double ease)
context - context of controllerchart - chart instanceease - if specified, this number represents how far to transition elements.void removeHoverStyle(ControllerContext context, IsChart chart, StyleElement element)
context - context of controllerchart - chart instanceelement - element to be removed.void setHoverStyle(ControllerContext context, IsChart chart, StyleElement element)
context - context of controllerchart - chart instanceelement - element to be set.void update(ControllerContext context, IsChart chart, boolean reset)
context - context of controllerchart - chart instancereset - if true, put the elements into a reset state so they can animate to their final values