hatemalimam / ChartistJSF

Highly Customizable Responsive Charts for JavaServer Faces.
https://chartistjsf-showcase.herokuapp.com
Apache License 2.0
39 stars 12 forks source link

lower boundary ignored #27

Open mydeadlyvenoms opened 6 years ago

mydeadlyvenoms commented 6 years ago

Hi everyone, It seems like the lower boundary is ignored - it should be reproducible using the following code. The upper boundary works fine.

Backing Bean

lineChartModel = new LineChartModel();
lineChartModel.setAspectRatio(AspectRatio.DOUBLE_OCTAVE);
lineChartModel.setShowArea(true);
lineChartModel.setFullWidth(true);
lineChartModel.setLow(0);
lineChartModel.setHigh(100);
lineChartModel.setShowPoint(false);

Axis xAxis = lineChartModel.getAxis(AxisType.X);
xAxis.setShowLabel(false);

LineChartSeries cpuUsage = new LineChartSeries();

for (int i = 0; i < 21; i++) {
    lineChartModel.addLabel(i);
    cpuUsage.set(ThreadLocalRandom.current().nextInt(30, 50 + 1));
}

lineChartModel.addSeries(cpuUsage);

Screenshot image

mydeadlyvenoms commented 6 years ago

Workaround: setLow(1)