Search in sources :

Example 1 with Bar

use of org.xclcharts.renderer.bar.Bar in project XCL-Charts by xcltapestry.

the class MultiAxisChart01View method renderBar.

/**
		 * 定制柱形顶上的标签格式
		 */
private void renderBar() {
    Bar bar = chart.getBar();
    bar.setItemLabelVisible(true);
    bar.setItemLabelRotateAngle(-90);
    bar.getItemLabelPaint().setFakeBoldText(true);
    chart.setItemLabelFormatter(new IFormatterDoubleCallBack() {

        @Override
        public String doubleFormatter(Double value) {
            // TODO Auto-generated method stub
            // DecimalFormat df=new DecimalFormat("#0.00");
            DecimalFormat df = new DecimalFormat("#0");
            return df.format(value).toString();
        }
    });
}
Also used : Bar(org.xclcharts.renderer.bar.Bar) IFormatterDoubleCallBack(org.xclcharts.common.IFormatterDoubleCallBack) DecimalFormat(java.text.DecimalFormat)

Aggregations

DecimalFormat (java.text.DecimalFormat)1 IFormatterDoubleCallBack (org.xclcharts.common.IFormatterDoubleCallBack)1 Bar (org.xclcharts.renderer.bar.Bar)1