Ejemplo n.º 1
0
  public void paint(Graphics2D g, ChartFrame cf, Rectangle bounds) {
    Dataset ls = visibleDataset(cf, LS);

    if (ls != null) {
      Range range = cf.getSplitPanel().getChartPanel().getRange();

      g.setColor(properties.getColor());
      g.setStroke(properties.getStroke());

      double y = cf.getChartData().getY(range.getLowerBound(), bounds, range, false);
      g.draw(new Line2D.Double(bounds.getMinX(), y, bounds.getMaxX(), y));

      for (int i = 0; i < ls.getItemsCount(); i++) {
        if (ls.getDataItem(i) != null) {
          double x = cf.getChartData().getX(i, bounds);
          double y1 = cf.getChartData().getY(range.getLowerBound(), bounds, range, false);
          double y2 = cf.getChartData().getY(range.getUpperBound(), bounds, range, false);
          double w = cf.getChartProperties().getBarWidth();

          g.draw(new Line2D.Double(x - w / 2, y1, x, y2));
          g.draw(new Line2D.Double(x + w / 2, y1, x, y2));
        }
      }
    }
  }
Ejemplo n.º 2
0
 public void paint(Graphics2D g, ChartFrame cf, Rectangle bounds) {
   Dataset d = visibleDataset(cf, HASHKEY);
   if (d != null) {
     Range range = cf.getSplitPanel().getChartPanel().getRange();
     DefaultPainter.line(
         g,
         cf,
         range,
         bounds,
         d,
         properties.getColor(),
         properties.getStroke(),
         Dataset.getPrice(properties.getPrice()));
   }
 }