Interface ValuesFormatter


public interface ValuesFormatter
Use this interface to use custom formatting for your indicator's tooltip and/or widgets values
  • Method Summary

    Modifier and Type Method Description
    java.lang.String formatTooltip​(double value, double minValue, double maxValue, int pixelsCount)
    This method will be called only if you don't implement formatTooltip(String, double, double, double, int)
    default java.lang.String formatTooltip​(java.lang.String alias, double value, double minValue, double maxValue, int pixelsCount)
    This is the main alias-specific method to format tooltip.
    java.lang.String formatWidget​(double value)
    This method will be called only if you don't implement formatWidget(String, double)
    default java.lang.String formatWidget​(java.lang.String alias, double value)
    This is the main alias-specific method to format widget.
  • Method Details

    • formatTooltip

      java.lang.String formatTooltip​(double value, double minValue, double maxValue, int pixelsCount)
      This method will be called only if you don't implement formatTooltip(String, double, double, double, int)
      Parameters:
      value - value displayed in tooltip
      minValue - bottom panel bottom pixel value
      maxValue - bottom panel top pixel value
      pixelsCount - height of bottom panel
      Returns:
      formatted value that will be displayed in tooltip, null if default formatter is to be used
    • formatTooltip

      default java.lang.String formatTooltip​(java.lang.String alias, double value, double minValue, double maxValue, int pixelsCount)
      This is the main alias-specific method to format tooltip. If you implement it, formatTooltip(double, double, double, int) will not be called. Otherwise, it will be called to format.
      Parameters:
      alias - of instrument
      value - value displayed in tooltip
      minValue - bottom panel bottom pixel value
      maxValue - bottom panel top pixel value
      pixelsCount - height of bottom panel
      Returns:
      formatted value that will be displayed in tooltip, null if default formatter is to be used
    • formatWidget

      java.lang.String formatWidget​(double value)
      This method will be called only if you don't implement formatWidget(String, double)
      Parameters:
      value - value displayed in widget
      Returns:
      formatted value that will be displayed in widget
    • formatWidget

      default java.lang.String formatWidget​(java.lang.String alias, double value)
      This is the main alias-specific method to format widget. If you implement it, formatTooltip(double, double, double, int) will not be called. Otherwise, it will be called to format.
      Parameters:
      alias - of instrument
      value - value displayed in widget
      Returns:
      formatted value that will be displayed in widget