Enum DefaultInteractionMode

    • Enum Constant Detail

      • NEAREST

        public static final DefaultInteractionMode NEAREST
        Gets the item that is nearest to the point.
        The nearest item is determined based on the distance to the center of the chart item (point, bar).
        If 2 or more items are at the same distance, the one with the smallest area is used.
      • INDEX

        public static final DefaultInteractionMode INDEX
        Finds all items at the same index. If the intersect setting is true, the first intersecting item is used to determine the index in the data.
        If intersect false the nearest item, in the x direction, is used to determine the index.
      • DATASET

        public static final DefaultInteractionMode DATASET
        Finds all items in the same dataset. If the intersect setting is true, the first intersecting item is used to determine the index in the data.
        If intersect false the nearest item is used to determine the index.
      • X

        public static final DefaultInteractionMode X
        Returns all items that would intersect based on the X coordinate of the position only.
        Note that this only applies to cartesian charts
      • Y

        public static final DefaultInteractionMode Y
        Returns all items that would intersect based on the Y coordinate of the position.
        Note that this only applies to cartesian charts.
    • Method Detail

      • values

        public static DefaultInteractionMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DefaultInteractionMode c : DefaultInteractionMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DefaultInteractionMode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • value

        public String value()
        Description copied from interface: Key
        Returns the name value of property
        Specified by:
        value in interface Key
        Returns:
        the name value of property
      • getMode

        public IsInteractionMode getMode()
        Description copied from interface: Interactioner
        Returns the name of interaction mode which must be used in chart options.
        Specified by:
        getMode in interface Interactioner
        Returns:
        the name of interaction mode
      • invoke

        public List<InteractionItem> invoke​(IsChart chart,
                                            ChartEventContext event,
                                            InteractionOptions options,
                                            boolean useFinalPosition)
        Description copied from interface: Interactioner
        Returns items which must be managed by CHART.JS event or hovering handler and by tooltips.
        Specified by:
        invoke in interface Interactioner
        Parameters:
        chart - the chart we are returning items from
        event - the event we are find things at
        options - options to use
        useFinalPosition - use final element position (animation target)
        Returns:
        items that are found