本文整理了Java中org.jfree.chart.plot.XYPlot.mapDatasetToRangeAxis()
方法的一些代码示例,展示了XYPlot.mapDatasetToRangeAxis()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XYPlot.mapDatasetToRangeAxis()
方法的具体详情如下:
包路径:org.jfree.chart.plot.XYPlot
类名称:XYPlot
方法名:mapDatasetToRangeAxis
[英]Maps a dataset to a particular range axis. All data will be plotted against axis zero by default, no mapping is required for this case.
[中]将数据集映射到特定的范围轴。默认情况下,所有数据都将以零轴为基准进行绘制,这种情况下不需要任何映射。
代码示例来源:origin: afranken/jmeter-analysis-maven-plugin
private XYPlot createResponseTimesPlot(AggregatedResponses aggregatedResponses) {
Samples durations = aggregatedResponses.getDuration();
// Distribution
double[] values = new double[durations.getSamples().size()];
for (int i = 0; i < durations.getSamples().size(); i++) {
values[i] = durations.getSamples().get(i);
}
HistogramDataset histogramdataset = new HistogramDataset();
histogramdataset.addSeries("Request Count", values, 40);
// Percentiles
List<Double> y = new ArrayList<Double>(Q + 1);
List<Long> x = new ArrayList<Long>(Q + 1);
Quantile quantile = durations.getQuantiles(Q);
// Add zero value
y.add(0D);
x.add(0L);
for (int i = 1; i < Q; i++) {
y.add(((double) i) / 10);
x.add(quantile.getQuantile(i));
}
// Add max value
y.add(100D);
x.add(durations.getMax());
XYPlot plot = ChartUtil.createResponseTimesPlot("Response Times (ms)");
ChartUtil.addDatasetRender(plot, new XYSeriesCollection(
createValuesSeries("Percentiles", x, y, 0)), ChartUtil.createLineAndShapeRenderer());
ChartUtil.addDatasetRender(plot, histogramdataset, ChartUtil.createBarRenderer());
plot.mapDatasetToRangeAxis(1, 1);
return plot;
}
代码示例来源:origin: org.n52.sensorweb/timeseries-io
public void setData(TimeseriesData data, TimeseriesMetadataOutput timeMetadata, StyleProperties style) {
getXYPlot().setDataset(timeseriesIndex, createTimeseriesCollection(data, style));
ValueAxis rangeAxis = createRangeAxis(timeMetadata);
getXYPlot().setRangeAxis(timeseriesIndex, rangeAxis);
getXYPlot().mapDatasetToRangeAxis(timeseriesIndex, timeseriesIndex);
}
代码示例来源:origin: stackoverflow.com
plot.mapDatasetToRangeAxis(1, 1); //2nd dataset to 2nd y-axi
代码示例来源:origin: org.n52.series-api/io
public void setData(Data<QuantityValue> data, DatasetOutput< ? > timeMetadata, StyleProperties style) {
getXYPlot().setDataset(timeseriesIndex, createTimeseriesCollection(data, style));
ValueAxis rangeAxis = createRangeAxis(timeMetadata);
getXYPlot().setRangeAxis(timeseriesIndex, rangeAxis);
getXYPlot().mapDatasetToRangeAxis(timeseriesIndex, timeseriesIndex);
}
代码示例来源:origin: senbox-org/snap-desktop
private void addArrayDataToSeries(int domainAxisIndex, int rangeAxisIndex, int datasetIndex, String yName, MetadataElement metadataElement,
double[] arrayIndices, String recordElementName) {
double[] yAxisData = new double[arrayIndices.length];
ProductData attributeData = metadataElement.getElement(recordElementName).getAttribute(yName).getData();
Arrays.setAll(yAxisData, attributeData::getElemDoubleAt);
String seriesKey = String.format("%s/%s", recordElementName, yName);
DefaultXYDataset dataset = new DefaultXYDataset();
dataset.addSeries(seriesKey, new double[][]{arrayIndices, yAxisData});
xyPlot.setDataset(datasetIndex, dataset);
xyPlot.mapDatasetToRangeAxis(datasetIndex, rangeAxisIndex);
xyPlot.mapDatasetToDomainAxis(datasetIndex, domainAxisIndex);
xyPlot.setRenderer(datasetIndex, creatItemRenderer(datasetIndex, ProductData.TYPE_INT32));
}
代码示例来源:origin: mdeverdelhan/ta4j-origins
/**
* Adds the cash flow axis to the plot.
* @param plot the plot
* @param dataset the cash flow dataset
*/
private static void addCashFlowAxis(XYPlot plot, TimeSeriesCollection dataset) {
final NumberAxis cashAxis = new NumberAxis("Cash Flow Ratio");
cashAxis.setAutoRangeIncludesZero(false);
plot.setRangeAxis(1, cashAxis);
plot.setDataset(1, dataset);
plot.mapDatasetToRangeAxis(1, 1);
final StandardXYItemRenderer cashFlowRenderer = new StandardXYItemRenderer();
cashFlowRenderer.setSeriesPaint(0, Color.blue);
plot.setRenderer(1, cashFlowRenderer);
}
代码示例来源:origin: bcdev/beam
timeSeriesPlot.setDataset(insituCollectionIndex, insituDataset);
timeSeriesPlot.mapDatasetToRangeAxis(cursorCollectionIndex, aliasIdx);
timeSeriesPlot.mapDatasetToRangeAxis(pinCollectionIndex, aliasIdx);
timeSeriesPlot.mapDatasetToRangeAxis(insituCollectionIndex, aliasIdx);
代码示例来源:origin: org.openfuxml/ofx-chart
plot.setRangeAxis(index, (ValueAxis)AxisFactory.createNumberAxis(ofxChart, axisOrientation));
plot.setDataset(index, mapXySeriesCollection.get(i));
plot.mapDatasetToRangeAxis(index, index);
代码示例来源:origin: org.n52.sensorweb/sensorwebclient-api
plot.mapDatasetToRangeAxis(i, i);
代码示例来源:origin: stackoverflow.com
plot.mapDatasetToRangeAxis(0, 0);
plot.mapDatasetToRangeAxis(1, 1);
代码示例来源:origin: us.ihmc/Plotting
plot.mapDatasetToRangeAxis(seriesCount, seriesCount);
代码示例来源:origin: us.ihmc/ihmc-swing-plotting
plot.mapDatasetToRangeAxis(seriesCount, seriesCount);
代码示例来源:origin: senbox-org/snap-desktop
private void configureRangeAxis(int index, MetadataElement metadataElement, String yAttributeName, String[] recordElementNames,
String refRecordName,
double[] recordIndices) {
double[] yAxisData = new double[recordIndices.length];
Arrays.setAll(yAxisData, i -> getDataAsDouble(metadataElement.getElement(recordElementNames[i]).getAttribute(yAttributeName).getData()));
DefaultXYDataset dataset2 = new DefaultXYDataset();
dataset2.addSeries(yAttributeName, new double[][]{recordIndices, yAxisData});
xyPlot.setDataset(index, dataset2);
xyPlot.mapDatasetToRangeAxis(index, index);
int yDataType = getAttributeType(metadataElement.getElement(refRecordName).getAttribute(yAttributeName));
ValueAxis yAxis = configureRangeIndex(index, yDataType);
String yUnit = metadataElement.getElement(refRecordName).getAttribute(yAttributeName).getUnit();
yAxis.setLabel(getYAxisLabel(yAttributeName, yUnit));
xyPlot.setRenderer(index, creatItemRenderer(index, yDataType));
}
代码示例来源:origin: org.graphstream/gs-algo
public JFreeChart createChart(PlotParameters params) throws PlotException {
XYSeriesCollection minMax = new XYSeriesCollection();
XYSeriesCollection avgCol = new XYSeriesCollection();
XYPlot plot;
XYBarRenderer r = new XYBarRenderer();
r.setBarPainter(new StandardXYBarPainter());
r.setMargin(0.35);
minMax.addSeries(min);
avgCol.addSeries(series);
minMax.addSeries(max);
JFreeChart chart = ChartFactory.createXYLineChart(params.title,
params.xAxisLabel, params.yAxisLabel, avgCol,
params.orientation, params.showLegend, true, false);
plot = ((XYPlot) chart.getPlot());
plot.setDataset(1, minMax);
plot.setRenderer(1, r);
if (separateMinMaxAxis) {
NumberAxis minMaxAxis = new NumberAxis("min/max");
plot.setRangeAxis(1, minMaxAxis);
plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
plot.mapDatasetToRangeAxis(1, 1);
}
return chart;
}
代码示例来源:origin: graphstream/gs-algo
public JFreeChart createChart(PlotParameters params) throws PlotException {
XYSeriesCollection minMax = new XYSeriesCollection();
XYSeriesCollection avgCol = new XYSeriesCollection();
XYPlot plot;
XYBarRenderer r = new XYBarRenderer();
r.setBarPainter(new StandardXYBarPainter());
r.setMargin(0.35);
minMax.addSeries(min);
avgCol.addSeries(series);
minMax.addSeries(max);
JFreeChart chart = ChartFactory.createXYLineChart(params.title,
params.xAxisLabel, params.yAxisLabel, avgCol,
params.orientation, params.showLegend, true, false);
plot = ((XYPlot) chart.getPlot());
plot.setDataset(1, minMax);
plot.setRenderer(1, r);
if (separateMinMaxAxis) {
NumberAxis minMaxAxis = new NumberAxis("min/max");
plot.setRangeAxis(1, minMaxAxis);
plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
plot.mapDatasetToRangeAxis(1, 1);
}
return chart;
}
代码示例来源:origin: mdeverdelhan/ta4j-origins
plot.mapDatasetToRangeAxis(index, 0);
XYLineAndShapeRenderer renderer2 = new XYLineAndShapeRenderer(true, false);
renderer2.setSeriesPaint(index, Color.blue);
代码示例来源:origin: org.n52.sensorweb/oxf-layer
plot.getRangeAxis(i).setRange((Double) tuples4FOI.getMinimum(i),
(Double) tuples4FOI.getMaximum(i));
plot.mapDatasetToRangeAxis(i, i);
代码示例来源:origin: senbox-org/snap-desktop
dataset1.addSeries(nameY1, new double[][]{xData, y1AxisData});
xyPlot.setDataset(0, dataset1);
xyPlot.mapDatasetToRangeAxis(0, 0);
xyPlot.setRenderer(0, creatItemRenderer(0, y1DataType));
dataset2.addSeries(nameY2, new double[][]{xData, y2AxisData});
xyPlot.setDataset(1, dataset2);
xyPlot.mapDatasetToRangeAxis(1, 1);
xyPlot.setRenderer(1, creatItemRenderer(1, y1DataType));
代码示例来源:origin: us.ihmc/ihmc-swing-plotting
axis.setAutoRange(true);
plot.setRangeAxis(1, axis);
plot.mapDatasetToRangeAxis(1, 1);
代码示例来源:origin: us.ihmc/Plotting
axis.setAutoRange(true);
plot.setRangeAxis(1, axis);
plot.mapDatasetToRangeAxis(1, 1);
内容来源于网络,如有侵权,请联系作者删除!