本文整理汇总了Java中org.wicketstuff.googlecharts.ChartAxis.setLabels方法的典型用法代码示例。如果您正苦于以下问题:Java ChartAxis.setLabels方法的具体用法?Java ChartAxis.setLabels怎么用?Java ChartAxis.setLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.wicketstuff.googlecharts.ChartAxis
的用法示例。
在下文中一共展示了ChartAxis.setLabels方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertLinePlot
import org.wicketstuff.googlecharts.ChartAxis; //导入方法依赖的package包/类
private void insertLinePlot(String wicketId, List<Metric> metrics) {
if ((metrics != null) && (metrics.size() > 0)) {
IChartData data = WicketUtils.getChartData(metrics);
ChartProvider provider = new ChartProvider(new Dimension(400, 100), ChartType.LINE,
data);
ChartAxis dateAxis = new ChartAxis(ChartAxisType.BOTTOM);
dateAxis.setLabels(new String[] { metrics.get(0).name,
metrics.get(metrics.size() / 2).name, metrics.get(metrics.size() - 1).name });
provider.addAxis(dateAxis);
ChartAxis commitAxis = new ChartAxis(ChartAxisType.LEFT);
commitAxis.setLabels(new String[] { "",
String.valueOf((int) WicketUtils.maxValue(metrics)) });
provider.addAxis(commitAxis);
provider.setLineStyles(new LineStyle[] { new LineStyle(2, 4, 0), new LineStyle(0, 4, 1) });
provider.addShapeMarker(new ShapeMarker(MarkerType.CIRCLE, Color.decode("#002060"), 1, -1, 5));
add(new Chart(wicketId, provider));
} else {
add(WicketUtils.newBlankImage(wicketId));
}
}
示例2: insertBarPlot
import org.wicketstuff.googlecharts.ChartAxis; //导入方法依赖的package包/类
private void insertBarPlot(String wicketId, List<Metric> metrics) {
if ((metrics != null) && (metrics.size() > 0)) {
IChartData data = WicketUtils.getChartData(metrics);
ChartProvider provider = new ChartProvider(new Dimension(400, 100),
ChartType.BAR_VERTICAL_SET, data);
ChartAxis dateAxis = new ChartAxis(ChartAxisType.BOTTOM);
List<String> labels = new ArrayList<String>();
for (Metric metric : metrics) {
labels.add(metric.name);
}
dateAxis.setLabels(labels.toArray(new String[labels.size()]));
provider.addAxis(dateAxis);
ChartAxis commitAxis = new ChartAxis(ChartAxisType.LEFT);
commitAxis.setLabels(new String[] { "",
String.valueOf((int) WicketUtils.maxValue(metrics)) });
provider.addAxis(commitAxis);
add(new Chart(wicketId, provider));
} else {
add(WicketUtils.newBlankImage(wicketId));
}
}
示例3: insertActivityGraph
import org.wicketstuff.googlecharts.ChartAxis; //导入方法依赖的package包/类
private void insertActivityGraph(List<Metric> metrics) {
if ((metrics != null) && (metrics.size() > 0)
&& GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
IChartData data = WicketUtils.getChartData(metrics);
ChartProvider provider = new ChartProvider(new Dimension(290, 100), ChartType.LINE,
data);
ChartAxis dateAxis = new ChartAxis(ChartAxisType.BOTTOM);
dateAxis.setLabels(new String[] { metrics.get(0).name,
metrics.get(metrics.size() / 2).name, metrics.get(metrics.size() - 1).name });
provider.addAxis(dateAxis);
ChartAxis commitAxis = new ChartAxis(ChartAxisType.LEFT);
commitAxis.setLabels(new String[] { "",
String.valueOf((int) WicketUtils.maxValue(metrics)) });
provider.addAxis(commitAxis);
provider.setLineStyles(new LineStyle[] { new LineStyle(2, 4, 0), new LineStyle(0, 4, 1) });
provider.addShapeMarker(new ShapeMarker(MarkerType.CIRCLE, Color.decode("#002060"), 1, -1, 5));
add(new Chart("commitsChart", provider));
} else {
add(WicketUtils.newBlankImage("commitsChart"));
}
}
示例4: insertLinePlot
import org.wicketstuff.googlecharts.ChartAxis; //导入方法依赖的package包/类
private void insertLinePlot(String wicketId, List<Metric> metrics) {
if ((metrics != null) && (metrics.size() > 0)) {
IChartData data = WicketUtils.getChartData(metrics);
ChartProvider provider = new ChartProvider(new Dimension(400, 100), ChartType.LINE,
data);
ChartAxis dateAxis = new ChartAxis(ChartAxisType.BOTTOM);
dateAxis.setLabels(new String[] { metrics.get(0).name,
metrics.get(metrics.size() / 2).name, metrics.get(metrics.size() - 1).name });
provider.addAxis(dateAxis);
ChartAxis commitAxis = new ChartAxis(ChartAxisType.LEFT);
commitAxis.setLabels(new String[] { "",
String.valueOf((int) WicketUtils.maxValue(metrics)) });
provider.addAxis(commitAxis);
provider.setLineStyles(new LineStyle[] { new LineStyle(2, 4, 0), new LineStyle(0, 4, 1) });
provider.addShapeMarker(new ShapeMarker(MarkerType.CIRCLE, Color.BLUE, 1, -1, 5));
add(new Chart(wicketId, provider));
} else {
add(WicketUtils.newBlankImage(wicketId));
}
}
示例5: insertActivityGraph
import org.wicketstuff.googlecharts.ChartAxis; //导入方法依赖的package包/类
private void insertActivityGraph(List<Metric> metrics) {
if ((metrics != null) && (metrics.size() > 0)
&& GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
IChartData data = WicketUtils.getChartData(metrics);
ChartProvider provider = new ChartProvider(new Dimension(290, 100), ChartType.LINE,
data);
ChartAxis dateAxis = new ChartAxis(ChartAxisType.BOTTOM);
dateAxis.setLabels(new String[] { metrics.get(0).name,
metrics.get(metrics.size() / 2).name, metrics.get(metrics.size() - 1).name });
provider.addAxis(dateAxis);
ChartAxis commitAxis = new ChartAxis(ChartAxisType.LEFT);
commitAxis.setLabels(new String[] { "",
String.valueOf((int) WicketUtils.maxValue(metrics)) });
provider.addAxis(commitAxis);
provider.setLineStyles(new LineStyle[] { new LineStyle(2, 4, 0), new LineStyle(0, 4, 1) });
provider.addShapeMarker(new ShapeMarker(MarkerType.CIRCLE, Color.BLUE, 1, -1, 5));
add(new Chart("commitsChart", provider));
} else {
add(WicketUtils.newBlankImage("commitsChart"));
}
}