我正在搜索在运行时更改X轴和Y轴的字符串的命令。我的gui上有语言菜单。一旦按下特定语言的按钮,我就会调用以下方法:
public void resetLanguage(Locale locale)
{
displayLanguage = locale;
resources = ResourceBundle.getBundle("DTTUI-Text", displayLanguage);
chart.setTitle(resources.getString("GUI_CHART_TITLE"));
measurement.setDescription(resources.getString("GUI_CHART_GRAPH_NAME"));
}
图表是JFreeChart,测量是XYSeries。任何人都知道如何找到轴标签的setter方法?提前谢谢!
我创建了这样的图表:
XYSeriesCollection collection = new XYSeriesCollection();
XYSeries series = new XYSeries("Title");
series.add(0, 0);
series.add(10,10);
collection.addSeries(series);
JFreeChart chart = ChartFactory.createXYLineChart("Title", "x",
"y", collection);