本文整理汇总了Java中org.jfree.data.statistics.StatisticalCategoryDataset.getMeanValue方法的典型用法代码示例。如果您正苦于以下问题:Java StatisticalCategoryDataset.getMeanValue方法的具体用法?Java StatisticalCategoryDataset.getMeanValue怎么用?Java StatisticalCategoryDataset.getMeanValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.statistics.StatisticalCategoryDataset
的用法示例。
在下文中一共展示了StatisticalCategoryDataset.getMeanValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _drawItem
import org.jfree.data.statistics.StatisticalCategoryDataset; //导入方法依赖的package包/类
private void _drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea,
CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset,
int row, int column, int pass) {
StatisticalCategoryDataset statDataset = (StatisticalCategoryDataset) dataset;
int visibleRow = state.getVisibleSeriesIndex(row);
int visibleRowCount = state.getVisibleSeriesCount();
PlotOrientation orientation = plot.getOrientation();
// current data point...
double x1;
if (getUseSeriesOffset()) {
x1 = domainAxis.getCategorySeriesMiddle(column,
dataset.getColumnCount(),
visibleRow, visibleRowCount,
getItemMargin(), dataArea, plot.getDomainAxisEdge());
}
else {
x1 = domainAxis.getCategoryMiddle(column, getColumnCount(),
dataArea, plot.getDomainAxisEdge());
}
Number meanValue = statDataset.getMeanValue(row, column);
if (meanValue == null) {
return;
}
double y1 = rangeAxis.valueToJava2D(meanValue.doubleValue(), dataArea,
plot.getRangeAxisEdge());
if (pass == 0 && getItemLineVisible(row, column)) {
if (column != 0) {
Number previousValue = statDataset.getValue(row, column - 1);
if(previousValue != null) {
// ignore this case here because the call to super.drawItem(...) took care if it.
return;
} else {
// previous data point...
Integer pIdx = findPreviousIndex(statDataset, row, column);
if(pIdx == null) {
return;
}
previousValue = statDataset.getValue(row, pIdx.intValue());
double previous = previousValue.doubleValue();
double x0;
if (getUseSeriesOffset()) {
x0 = domainAxis.getCategorySeriesMiddle(
pIdx.intValue(), dataset.getColumnCount(),
visibleRow, visibleRowCount,
getItemMargin(), dataArea,
plot.getDomainAxisEdge());
}
else {
x0 = domainAxis.getCategoryMiddle(pIdx.intValue(),
getColumnCount(), dataArea,
plot.getDomainAxisEdge());
}
double y0 = rangeAxis.valueToJava2D(previous, dataArea,
plot.getRangeAxisEdge());
Line2D line = null;
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(y0, x0, y1, x1);
}
else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(x0, y0, x1, y1);
}
g2.setPaint(getItemPaint(row, column));
g2.setStroke(getItemStroke(row, column));
g2.draw(line);
}
}
}
}