本文整理汇总了Java中com.googlecode.wickedcharts.highcharts.options.Options.addyAxis方法的典型用法代码示例。如果您正苦于以下问题:Java Options.addyAxis方法的具体用法?Java Options.addyAxis怎么用?Java Options.addyAxis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.googlecode.wickedcharts.highcharts.options.Options
的用法示例。
在下文中一共展示了Options.addyAxis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOptionsForHistoricalChart
import com.googlecode.wickedcharts.highcharts.options.Options; //导入方法依赖的package包/类
/**
*
* @return
*/
public Options getOptionsForHistoricalChart() {
TreeNodeService dataService = null;
Project proj = null;
try {
InitialContext ic = new InitialContext();
dataService = (TreeNodeService) ic.lookup("java:module/TreeNodeService");
// Obtain project from the settings
if (settings.get("project") != null) {
proj = dataService.getProjectByName(settings.get("project"));
} else {
if (dataService != null) {
proj = dataService.getProjectByName("U-QASAR Platform Development");
}
}
} catch (NamingException e) {
e.printStackTrace();
}
Options options = new Options();
ChartOptions chartOptions = new ChartOptions();
// Obtain the historic values for the project
List<HistoricValuesProject> projectHistoricvalues = getHistoricalValues(proj);
Collections.sort(projectHistoricvalues);
SeriesType seriesType = SeriesType.LINE;
chartOptions.setType(seriesType);
options.setTitle(new Title("Historical Project Quality"));
PointSeries series = new PointSeries();
series.setType(seriesType);
List<String> xAxisLabels = new ArrayList<>();
for (HistoricValuesProject historicValue : projectHistoricvalues) {
float value = historicValue.getValue();
System.out.println("Value: " +value);
series.addPoint(new Point(proj.getAbbreviatedName(), value));
// xAxis Label
Date date = historicValue.getDate();
SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
xAxisLabels.add(dt1.format(date));
}
// Date on xAxis
Axis xAxis = new Axis();
xAxis.setType(AxisType.DATETIME);
xAxis.setCategories(xAxisLabels);
xAxis.setLabels(new Labels()
.setRotation(-60)
.setAlign(HorizontalAlignment.RIGHT)
.setStyle(new CssStyle()
.setProperty("font-size", "9px")
.setProperty("font-family", "Verdana, sans-serif")));
options.setxAxis(xAxis);
options.addyAxis(new Axis()
.setMin(0)
.setMax(100));
options.addSeries(series);
options.setChartOptions(chartOptions);
return options;
}