/** Called to update and layout the content for the plot */
  @Override
  protected void layoutPlotChildren() {
    // we have nothing to layout if no data is present
    if (getData() == null) {
      return;
    }
    // update candle positions
    for (int seriesIndex = 0; seriesIndex < getData().size(); seriesIndex++) {
      Series<String, Number> series = getData().get(seriesIndex);
      Iterator<Data<String, Number>> iter = getDisplayedDataIterator(series);
      Path seriesPath = null;
      if (series.getNode() instanceof Path) {
        seriesPath = (Path) series.getNode();
        seriesPath.getElements().clear();
      }
      while (iter.hasNext()) {
        Data<String, Number> item = iter.next();
        double x = getXAxis().getDisplayPosition(getCurrentDisplayedXValue(item));
        double y = getYAxis().getDisplayPosition(getCurrentDisplayedYValue(item));
        Node itemNode = item.getNode();
        BarData bar = (BarData) item.getExtraValue();
        if (itemNode instanceof Candle && item.getYValue() != null) {
          Candle candle = (Candle) itemNode;

          double close = getYAxis().getDisplayPosition(bar.getClose());
          double high = getYAxis().getDisplayPosition(bar.getHigh());
          double low = getYAxis().getDisplayPosition(bar.getLow());
          double candleWidth = 10;
          // update candle
          candle.update(close - y, high - y, low - y, candleWidth);

          // update tooltip content
          candle.updateTooltip(bar.getOpen(), bar.getClose(), bar.getHigh(), bar.getLow());

          // position the candle
          candle.setLayoutX(x);
          candle.setLayoutY(y);
        }
      }
    }
  }