-
- All Implemented Interfaces:
-
com.patrykandpatrick.vico.core.formatter.ValueFormatter
public class PercentageFormatValueFormatter implements ValueFormatter
A ValueFormatter implementation that converts y-axis values to percentages. It uses DecimalFormat to format values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPercentageFormatValueFormatter.Companion
-
Constructor Summary
Constructors Constructor Description PercentageFormatValueFormatter()Creates a PercentageFormatValueFormatter using the default percentage pattern. PercentageFormatValueFormatter(String pattern)
-
Method Summary
Modifier and Type Method Description StringformatValue(Float value, ChartValues chartValues)Called to format axis labels and data labels. -
-
Constructor Detail
-
PercentageFormatValueFormatter
PercentageFormatValueFormatter()
Creates a PercentageFormatValueFormatter using the default percentage pattern.
-
PercentageFormatValueFormatter
PercentageFormatValueFormatter(String pattern)
- Parameters:
pattern- the pattern used by DecimalFormat to format values as percentages.
-
-
Method Detail
-
formatValue
String formatValue(Float value, ChartValues chartValues)
Called to format axis labels and data labels.
- Parameters:
value- the value to be formatted.chartValues- the ChartValues used by the chart.
-
-
-
-