本文整理汇总了Java中org.knowm.xchart.XYChart.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java XYChart.setTitle方法的具体用法?Java XYChart.setTitle怎么用?Java XYChart.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.knowm.xchart.XYChart
的用法示例。
在下文中一共展示了XYChart.setTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import org.knowm.xchart.XYChart; //导入方法依赖的package包/类
public static void show(String chartTitle, NumericColumn xColumn, NumericColumn yColumn, ViewGroup group) {
XYChart chart = new XYChart(DEFAULT_WIDTH, DEFAULT_HEIGHT);
chart.setTitle(chartTitle);
chart.setXAxisTitle(xColumn.name());
chart.setYAxisTitle(yColumn.name());
chart.getStyler().setTheme(new TablesawTheme());
chart.getStyler().setMarkerSize(5);
chart.getStyler().setDefaultSeriesRenderStyle(XYSeries.XYSeriesRenderStyle.Scatter);
for (TemporaryView view : group) {
double[] xData = view.numericColumn(xColumn.name()).toDoubleArray();
double[] yData = view.numericColumn(yColumn.name()).toDoubleArray();
chart.addSeries(view.name(), Arrays.copyOf(xData, xData.length), Arrays.copyOf(yData, yData.length));
}
new SwingWrapper<>(chart).displayChart(WINDOW_TITLE);
}
示例2: show
import org.knowm.xchart.XYChart; //导入方法依赖的package包/类
public static void show(String chartTitle, NumericColumn xColumn, NumericColumn yColumn, ViewGroup group) {
XYChart chart = new XYChart(DEFAULT_WIDTH, DEFAULT_HEIGHT);
chart.setTitle(chartTitle);
chart.setXAxisTitle(xColumn.name());
chart.setYAxisTitle(yColumn.name());
chart.getStyler().setTheme(new TablesawTheme());
chart.getStyler().setMarkerSize(5);
chart.getStyler().setDefaultSeriesRenderStyle(XYSeries.XYSeriesRenderStyle.Scatter);
for (TemporaryView view : group) {
double[] xData = view.numericColumn(xColumn.name()).toDoubleArray();
double[] yData = view.numericColumn(yColumn.name()).toDoubleArray();
chart.addSeries(view.name(), Arrays.copyOf(xData, xData.length), Arrays.copyOf(yData, yData.length));
}
new SwingWrapper<>(chart).displayChart(WINDOW_TITLE);
}
示例3: show
import org.knowm.xchart.XYChart; //导入方法依赖的package包/类
public static void show(String chartTitle, double[] xData, NumericColumn yColumn, int width, int height) {
double[] yData = yColumn.toDoubleArray();
// Create Chart
XYChart chart = new XYChart(width, height);
chart.setTitle(chartTitle);
chart.setYAxisTitle(yColumn.name());
chart.getStyler().setTheme(new TablesawTheme());
chart.getStyler().setMarkerSize(2);
chart.getStyler().setDefaultSeriesRenderStyle(XYSeries.XYSeriesRenderStyle.Scatter);
XYSeries series = chart.addSeries("Ranked: " + yColumn.name(), xData, yData);
series.setMarker(SeriesMarkers.CIRCLE);
new SwingWrapper<>(chart).displayChart(WINDOW_TITLE);
}