在jFreeChart中设置垂直轴标签的货币格式 [英] Setting currency format for labels of vertical axis in jFreeChart
问题描述
更多详细信息:我有时间系列图表,纵轴应具有货币格式的标签,例如
$ 100,000 000
$ 50 000
$ c
现在我有相同的标签,但没有美元符号和范围分隔符。
对于水平轴,我使用了这种方法:
$ $ $ $ $ $ $ $ $ DateAxis axis =(DateAxis)plot.getDomainAxis();
axis.setDateFormatOverride(new SimpleDateFormat(yyyy));
它可以工作。
当我尝试做类似的事情
ValueAxis valueAxis =(ValueAxis)plot.getRangeAxis();
我不能找到任何方法来格式化标签。
请帮助我。 The essential of question is declared at the title. More details: I have the Time series chart, and vertical axis should has labels in currency format like this Now I have the same labels, but without dollar sign and range delimiter. For horizontal axis I used this approach: And it works. When I try to do similar ValueAxis valueAxis = (ValueAxis) plot.getRangeAxis(); I can't find any method to format labels. Please, help me. The 这篇关于在jFreeChart中设置垂直轴标签的货币格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! ChartFactory.createTimeSeriesChart()
工厂提供了一个<$ c setNumberFormatOverride()
与本地货币格式化程序配合使用,如这里。 $100, 000, 000
$50, 000
...
DateAxis axis = (DateAxis) plot.getDomainAxis();
axis.setDateFormatOverride(new SimpleDateFormat("yyyy"));
ChartFactory.createTimeSeriesChart()
factory supplies a NumberAxis
for the range, so you can use setNumberFormatOverride()
for with a localized currency formatter, as shown here.