예제 #1
0
 /**
  * This has the same functionality as the super class of {@link Histogram}, except it calls
  * getDateLabel instead of just getLabel which will format the label as a date
  */
 public void drawXLabels(
     List<Double> xLabels,
     Double[] xTextLabelLocations,
     Canvas canvas,
     Paint paint,
     int left,
     int top,
     int bottom,
     double xPixelsPerUnit,
     double minX,
     double maxX) {
   XYMultipleSeriesRenderer renderer = mChart.getRenderer();
   int length = xLabels.size();
   boolean showLabels = renderer.isShowLabels();
   boolean showGrid = renderer.isShowGrid();
   for (int i = 0; i < length; i++) {
     double label = xLabels.get(i);
     float xLabel = (float) (left + xPixelsPerUnit * (label - minX));
     if (showLabels) {
       paint.setColor(renderer.getLabelsColor());
       canvas.drawLine(xLabel, bottom, xLabel, bottom + renderer.getLabelsTextSize() / 3, paint);
       mChart.drawText(
           canvas,
           getDateLabel(label),
           xLabel,
           bottom + renderer.getLabelsTextSize() * 4 / 3,
           paint,
           renderer.getXLabelsAngle());
     }
     if (showGrid) {
       paint.setColor(renderer.getGridColor());
       canvas.drawLine(xLabel, bottom, xLabel, top, paint);
     }
   }
   mChart.drawXTextLabels(
       xTextLabelLocations,
       canvas,
       paint,
       showLabels,
       left,
       top,
       bottom,
       xPixelsPerUnit,
       minX,
       maxX);
 }