Advertisement
Fhernd

Formatter.java

Sep 6th, 2017
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. package co.ortizol;
  2.  
  3. import com.github.mikephil.charting.charts.BarLineChartBase;
  4. import com.github.mikephil.charting.components.AxisBase;
  5. import com.github.mikephil.charting.formatter.IAxisValueFormatter;
  6.  
  7. public class Formatter implements IAxisValueFormatter {
  8.  
  9.     private BarLineChartBase<?> chart;
  10.  
  11.     public Formatter(BarLineChartBase<?> chart) {
  12.         this.chart = chart;
  13.     }
  14.  
  15.     @Override
  16.     public String getFormattedValue(float value, AxisBase axis) {
  17.         if (value == 1) {
  18.             return "Lunes";
  19.         } else if (value == 2) {
  20.             return "Martes";
  21.         } else if (value == 3) {
  22.             return "Miércoles";
  23.         } else if (value == 4) {
  24.             return "Jueves";
  25.         } else if (value == 5) {
  26.             return "Viernes";
  27.         } else if (value == 6) {
  28.             return "Sábado";
  29.         } else {
  30.             return "";
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement