I want the max Y value and the min Y value to be +20 and -20 respectively so the height of the bar fits the entire content of the card.
But i cant seem to find the option, to set the max/min like i want and there is always empty space above and below.
I have tried almost every possible way with CartesianLinearTicks, but it doesn't make what i want.
I also tried using the Extender, but it doesn't seem to change any value, no matter how i use it.
Java Code for reference:
Code: Select all
barModel = initializeData();
BarChartOptions options=new BarChartOptions();
CartesianScales cScales=new CartesianScales();
CartesianLinearAxes linearAxes=new CartesianLinearAxes();
linearAxes.setStacked(true);
cScales.addXAxesData(linearAxes);
options.setScales(cScales);
Legend legend=new Legend();
legend.setPosition("bottom");
options.setLegend(legend);
Title titleChart=new Title();
titleChart.setDisplay(true);
titleChart.setText(title);
options.setTitle(titleChart);
Tooltip tooltip=new Tooltip();
tooltip.setMode("index");
tooltip.setIntersect(false);
options.setTooltip(tooltip);
barModel.setOptions(options);
return barModel;