/** * Set the data to a double array * * @param data * The data */ public void setData(final double[] data) { super.data.clear(); if (this.useFixedBarWidth) for (int i = 0; i < data.length; i++) super.data.add(new LocatedObject<Bar>(i, data[i], new Bar(data[i], i, i + this.barWidth, RGBColour.RED))); else for (int i = 0; i < data.length; i++) super.data.add(new LocatedObject<Bar>(i, data[i], new Bar(data[i], i, i + this.barWidth, RGBColour.RED))); super.validateData(); this.axesRenderer2D.setMaxXValue(data.length); // Force the axis to be zero if the axis always visible flag is set if (axisAlwaysVisible) if (getMinValue() > 0) setMinValue(0); else if (getMaxValue() < 0) setMaxValue(0); super.updateVis(); }