本文整理汇总了Java中info.monitorenter.gui.chart.Chart2D.getAxisY方法的典型用法代码示例。如果您正苦于以下问题:Java Chart2D.getAxisY方法的具体用法?Java Chart2D.getAxisY怎么用?Java Chart2D.getAxisY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类info.monitorenter.gui.chart.Chart2D
的用法示例。
在下文中一共展示了Chart2D.getAxisY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: internalGetNegativeYError
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* @see info.monitorenter.gui.chart.errorbars.AErrorBarPolicyConfigurable#internalGetNegativeYError(int,
* int, info.monitorenter.gui.chart.ITracePoint2D)
*/
@Override
protected int internalGetNegativeYError(final int xPixel, final int yPixel,
final ITracePoint2D original) {
final ITrace2D trace = this.getTrace();
final Chart2D chart = trace.getRenderer();
final IAxis<?> axisY = chart.getAxisY();
// We cannot use IAxis.translateRelativeValueToPX because non-linear
// transformations of axis implementations (e.g. log) will put the distance
// argument in relation to 0 and return wrong results:
final int result = axisY.translateValueToPx(original.getY() - this.m_yError);
return result;
}
示例2: internalGetPositiveYError
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* @see info.monitorenter.gui.chart.errorbars.AErrorBarPolicyConfigurable#internalGetPositiveYError(int,
* int, info.monitorenter.gui.chart.ITracePoint2D)
*/
@Override
protected int internalGetPositiveYError(final int xPixel, final int yPixel,
final ITracePoint2D original) {
final ITrace2D trace = this.getTrace();
final Chart2D chart = trace.getRenderer();
final IAxis<?> axisY = chart.getAxisY();
// We cannot use IAxis.translateRelativeValueToPX because non-linear
// transformations of axis implementations (e.g. log) will put the distance
// argument in relation to 0 and return wrong results:
final int result = axisY.translateValueToPx(original.getY() + this.m_yError);
return result;
}
示例3: createChart
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
private Chart2D createChart() {
Chart2D chart = new Chart2D();
chart.setPaintLabels(true);
chart.setUseAntialiasing(true);
chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
x_achse = chart.getAxisX();
x_achse.getAxisTitle().setTitle("Minuten");
x_achse.setPaintScale(true);
x_achse.setVisible(true);
x_achse.setPaintGrid(false);
x_achse.setMajorTickSpacing(10);
x_achse.setMinorTickSpacing(1);
IAxis<?> y_achse = chart.getAxisY();
y_achse.getAxisTitle().setTitle("");
y_achse.setPaintScale(true);
y_achse.setVisible(true);
y_achse.setPaintGrid(true);
y_achse.setMajorTickSpacing(5);
y_achse.setMinorTickSpacing(1);
y_achse.setFormatter(new LabelFormatterAutoUnits());
y_achse.setRangePolicy(new RangePolicyForcedPoint());
m_trace.setName("");
m_trace.setColor(Color.RED);
chart.addTrace(m_trace);
return chart;
}
示例4: AxisScalePolicyManualTickChart
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* Defcon.
*/
@SuppressWarnings("unchecked")
private AxisScalePolicyManualTickChart() {
this.setLayout(new BorderLayout());
Chart2D chart = new Chart2D();
/*
* This does the trick to configure the ticks manually:
*
* Note: The dirty cast is needed as we want to reuse the axis of the chart.
* If we wanted to avoid it we had to create a new instance and set it.
*/
IAxis<IAxisScalePolicy> xAxis = (IAxis<IAxisScalePolicy>)chart.getAxisX();
xAxis.setAxisScalePolicy(new AxisScalePolicyManualTicks());
xAxis.setMajorTickSpacing(10);
xAxis.setMinorTickSpacing(1);
xAxis.setStartMajorTick(true);
IAxis<IAxisScalePolicy> yAxis = (IAxis<IAxisScalePolicy>)chart.getAxisY();
yAxis.setAxisScalePolicy(new AxisScalePolicyManualTicks());
yAxis.setMajorTickSpacing(50);
yAxis.setMinorTickSpacing(10);
yAxis.setStartMajorTick(true);
// Note that AxixScalePolicyManualTicks should start with the first label with respect to the range policy:
IRangePolicy rangePolicyX = new RangePolicyFixedViewport( new Range( 30,100 ));
xAxis.setRangePolicy(rangePolicyX);
IRangePolicy rangePolicyY = new RangePolicyFixedViewport( new Range( 15,100 ));
yAxis.setRangePolicy(rangePolicyY);
// Create an ITrace:
// Note that dynamic charts need limited amount of values!!!
// ITrace2D trace = new Trace2DLtd(200);
ITrace2D trace = new Trace2DSimple();
trace.setColor(Color.RED);
// Add the trace to the chart:
chart.addTrace(trace);
// Add all points, as it is static:
for (int i = 21; i <= 40; i++) {
trace.addPoint(i, /*100.0/(i+1.0)*/i);
}
chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
// Make it visible:
this.add(new ChartPanel(chart), BorderLayout.CENTER);
}