// Determine if the rangeAxis should be added to the left or right range panel
int numLeftAxes = leftPanel.getChildCount();
int numRightAxes = rightPanel.getChildCount();
boolean useLeftPanel = (numLeftAxes <= numRightAxes);
CompositeAxisPanel compositePanel = useLeftPanel || !plot.isMultiaxis() ? leftPanel : rightPanel;
if (rangeAxis == null) {
rangeAxis = new RangeAxis(dataset.getRangeLabel(), rangeAxisId);
rangeAxis.setPlot(plot);
rangeAxis.setView(view);
rangeAxis.setAxisIndex(i);
id2rangeAxis.put(rangeAxisId, rangeAxis);
}
if (!localRangeAxisIds.contains(rangeAxisId)) {
if (axisPanel == null || plot.isMultiaxis()) {
axisPanel = new RangeAxisPanel();
axisPanel.setValueAxis(rangeAxis);
compositePanel.add(axisPanel);
}
rangeAxis.setAxisPanel(axisPanel);
double tickLabelHeight = Math.min(axisPanel.getMaxLabelHeight(), 12);
rangeAxis.setTickLabelHeight(tickLabelHeight);
localRangeAxisIds.add(rangeAxisId);