/** * {@inheritDoc} * * Adds a sublabel for a category. */ @Override public void addSubLabel(@SuppressWarnings("rawtypes") Comparable category, String label) { super.addSubLabel(category, convertLabel(label)); }
/** * {@inheritDoc} * * Adds a sublabel for a category. */ @Override public void addSubLabel(@SuppressWarnings("rawtypes") Comparable category, String label) { super.addSubLabel(category, convertLabel(label)); }
/** * @param barChart TODO * @param subLabelClass */ private static void addSubLabels(JFreeChart barChart, String subLabelClass) { ExtendedCategoryAxis subLabels; CategoryPlot plot = barChart.getCategoryPlot(); try { subLabels = (ExtendedCategoryAxis) Class.forName(subLabelClass).newInstance(); List<?> cats = plot.getCategories(); for(int i=0; i<cats.size(); i++) { subLabels.addSubLabel((Comparable<?>)cats.get(i), cats.get(i).toString()); } plot.setDomainAxis(subLabels); } catch (InstantiationException e) { LOG.error("getBarChart: Couldn't instantiate configured CategorySubLabels class: {}", subLabelClass, e); } catch (IllegalAccessException e) { LOG.error("getBarChart: Couldn't instantiate configured CategorySubLabels class: {}", subLabelClass, e); } catch (ClassNotFoundException e) { LOG.error("getBarChart: Couldn't instantiate configured CategorySubLabels class: {}", subLabelClass, e); } }
/** * @param barChart TODO * @param subLabelClass */ private static void addSubLabels(JFreeChart barChart, String subLabelClass) { ExtendedCategoryAxis subLabels; CategoryPlot plot = barChart.getCategoryPlot(); try { subLabels = (ExtendedCategoryAxis) Class.forName(subLabelClass).newInstance(); List<?> cats = plot.getCategories(); for(int i=0; i<cats.size(); i++) { subLabels.addSubLabel((Comparable<?>)cats.get(i), cats.get(i).toString()); } plot.setDomainAxis(subLabels); } catch (InstantiationException e) { LOG.error("getBarChart: Couldn't instantiate configured CategorySubLabels class: {}", subLabelClass, e); } catch (IllegalAccessException e) { LOG.error("getBarChart: Couldn't instantiate configured CategorySubLabels class: {}", subLabelClass, e); } catch (ClassNotFoundException e) { LOG.error("getBarChart: Couldn't instantiate configured CategorySubLabels class: {}", subLabelClass, e); } }