- g.setColor(currentColour);
- value = _data.getData(selectedPoint);
- y = (int) (yScaleFactor * (value - minValue));
- g.fillRect(BORDER_WIDTH + x, height-BORDER_WIDTH - y, barWidth, y);
+ if (_data.hasData(selectedPoint))
+ {
+ g.setColor(currentColour);
+ value = _data.getData(selectedPoint);
+ y = (int) (yScaleFactor * (value - minValue));
+ g.fillRect(BORDER_WIDTH + x, height-BORDER_WIDTH - y, barWidth, y);
+ }