本文整理汇总了Java中com.xeiam.xchart.StyleManager.ChartType类的典型用法代码示例。如果您正苦于以下问题:Java ChartType类的具体用法?Java ChartType怎么用?Java ChartType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChartType类属于com.xeiam.xchart.StyleManager包,在下文中一共展示了ChartType类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: makeBarChart
import com.xeiam.xchart.StyleManager.ChartType; //导入依赖的package包/类
/**
* Creates a frequency bar diagram based on the frequency map.
*
* @param freqMap
* frequency map
* @param seriesName
* name of the series
* @return chart
*/
private static Chart makeBarChart(final Map<String, Integer> freqMap,
final String seriesName) {
final int frameWidth = 800;
final int frameHeight = 600;
// Convert input data for processing
ArrayList<String> labels = new ArrayList<String>(freqMap.keySet());
ArrayList<Integer> frequency = new ArrayList<Integer>(freqMap.values());
// Create Chart
Chart chart = new ChartBuilder().chartType(ChartType.Bar)
.width(frameWidth).height(frameHeight).title("Score Histogram")
.xAxisTitle(seriesName).yAxisTitle("Frequency").build();
chart.addSeries(seriesName, new ArrayList<String>(labels),
new ArrayList<Integer>(frequency));
// Customize Chart
chart.getStyleManager().setLegendPosition(LegendPosition.InsideNW);
return chart;
}
开发者ID:adamIqbal,项目名称:Health,代码行数:31,代码来源:FreqBar.java
示例2: createChart
import com.xeiam.xchart.StyleManager.ChartType; //导入依赖的package包/类
public static Chart createChart(String title, int minX, int maxX, LegendPosition position) {
Chart chart = new ChartBuilder().width(235).height(200).build();
// Customize Chart
chart.setChartTitle(title);
chart.getStyleManager().setChartTitleVisible(true);
chart.getStyleManager().setChartTitleFont(new Font("Arial", Font.PLAIN, 10));
chart.getStyleManager().setLegendPosition(position);
chart.getStyleManager().setLegendVisible(true);
chart.getStyleManager().setLegendFont(new Font("Arial", Font.PLAIN, 10));
chart.getStyleManager().setLegendPadding(6);
chart.getStyleManager().setLegendSeriesLineLength(6);
chart.getStyleManager().setAxisTickLabelsFont(new Font("Arial", Font.PLAIN, 9));
chart.getStyleManager().setXAxisMin(minX);
chart.getStyleManager().setXAxisMax(maxX);
chart.getStyleManager().setChartBackgroundColor(Color.white);
chart.getStyleManager().setChartPadding(4);
chart.getStyleManager().setChartType(ChartType.Line);
return chart;
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:23,代码来源:RealDistributionComparison.java
示例3: createChart
import com.xeiam.xchart.StyleManager.ChartType; //导入依赖的package包/类
public static Chart createChart(String title, int width, int height,
LegendPosition position, boolean legendVisible) {
Chart chart = new ChartBuilder().width(width).height(height).build();
// Customize Chart
chart.setChartTitle(title);
chart.getStyleManager().setChartTitleVisible(true);
chart.getStyleManager().setChartTitleFont(new Font("Arial", Font.PLAIN, 12));
chart.getStyleManager().setLegendPosition(position);
chart.getStyleManager().setLegendVisible(legendVisible);
chart.getStyleManager().setLegendFont(new Font("Arial", Font.PLAIN, 12));
chart.getStyleManager().setLegendPadding(6);
chart.getStyleManager().setLegendSeriesLineLength(10);
chart.getStyleManager().setAxisTickLabelsFont(new Font("Arial", Font.PLAIN, 10));
chart.getStyleManager().setChartBackgroundColor(Color.white);
chart.getStyleManager().setChartPadding(4);
chart.getStyleManager().setChartType(ChartType.Line);
return chart;
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:22,代码来源:ConstantVoltageExample.java
示例4: createChart
import com.xeiam.xchart.StyleManager.ChartType; //导入依赖的package包/类
public static Chart createChart(String title, LegendPosition position) {
Chart chart = new ChartBuilder().width(650).height(450).build();
// Customize Chart
chart.setChartTitle(title);
chart.getStyleManager().setChartTitleVisible(true);
chart.getStyleManager().setChartTitleFont(new Font("Arial", Font.PLAIN, 12));
chart.getStyleManager().setLegendPosition(position);
chart.getStyleManager().setLegendVisible(true);
chart.getStyleManager().setLegendFont(new Font("Arial", Font.PLAIN, 12));
chart.getStyleManager().setLegendPadding(6);
chart.getStyleManager().setLegendSeriesLineLength(10);
chart.getStyleManager().setAxisTickLabelsFont(new Font("Arial", Font.PLAIN, 10));
chart.getStyleManager().setChartBackgroundColor(Color.white);
chart.getStyleManager().setChartPadding(4);
chart.getStyleManager().setChartType(ChartType.Line);
return chart;
}
开发者ID:Quanticol,项目名称:CARMA,代码行数:21,代码来源:CannonballExample.java
示例5: createWeeklySubmissionChart
import com.xeiam.xchart.StyleManager.ChartType; //导入依赖的package包/类
public static Chart createWeeklySubmissionChart( SortedMap<Date,Integer> input, boolean bar) {
SortedMap<Date,Integer> filledIn = Util.fillInMissing(input, new WeekIncrementer(), 0);
List<Date> weeks = new ArrayList<Date>();
List<Number> submissionCounts = new ArrayList<Number>();
for (Date date : filledIn.keySet()) {
weeks.add(date);
submissionCounts.add(filledIn.get(date));
}
// Create Chart
ChartBuilder chartBuilder = new ChartBuilder().
width(1000).height(300).
xAxisTitle("Week").yAxisTitle("Submission Count").
theme(ChartTheme.GGPlot2);
if (bar) chartBuilder = chartBuilder.chartType(ChartType.Bar);
Chart chart = chartBuilder.build();
chart.addSeries("Submission Count", weeks, submissionCounts);
return chart;
}
开发者ID:Sage-Bionetworks,项目名称:EvaluationStatistics,代码行数:22,代码来源:EvaluationStatistics.java
示例6: chartType
import com.xeiam.xchart.StyleManager.ChartType; //导入依赖的package包/类
private static ChartType chartType(final PlotType type) {
switch (type) {
case AREA: return ChartType.Area;
case BAR: return ChartType.Bar;
case GRID:
case SCATTER: return ChartType.Scatter;
case SCATTER_WITH_TREND:
case GRID_WITH_TREND:
case LINE:
default: return ChartType.Line;
}
}
开发者ID:cardillo,项目名称:joinery,代码行数:13,代码来源:Display.java
注:本文中的com.xeiam.xchart.StyleManager.ChartType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论