本文整理汇总了Java中info.monitorenter.gui.chart.Chart2D.setToolTipType方法的典型用法代码示例。如果您正苦于以下问题:Java Chart2D.setToolTipType方法的具体用法?Java Chart2D.setToolTipType怎么用?Java Chart2D.setToolTipType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类info.monitorenter.gui.chart.Chart2D
的用法示例。
在下文中一共展示了Chart2D.setToolTipType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MinimalStaticChartWithNanValues
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* Defcon.
*/
private MinimalStaticChartWithNanValues() {
this.setLayout(new BorderLayout());
Chart2D chart = new Chart2D();
// 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:
trace.addPoint(0, 0);
trace.addPoint(1, 10);
trace.addPoint(2, Double.NaN);
trace.addPoint(3, 10);
trace.addPoint(4, 15);
trace.addPoint(5, Double.NaN);
trace.addPoint(6, 16);
trace.addPoint(7, 14);
trace.addPoint(8, 13);
chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
// Make it visible:
this.add(chart, BorderLayout.CENTER);
}
示例2: main
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* Demo application startup method.
* <p>
*
* @param args
* ignored.
* @throws IOException
* if loading data for the demo chart fails.
*/
public static void main(final String[] args) throws IOException {
Chart2D chart = new Chart2D();
chart.enablePointHighlighting(true);
chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
ITrace2D trace = new Trace2DLtd(400);
AStaticDataCollector collector = new PropertyFileStaticDataCollector(trace,
CoordinateViewChart.class.getResourceAsStream("data.properties"));
chart.addTrace(trace);
trace.setPointHighlighter(new PointPainterDisc(10));
collector.collectData();
new CoordinateViewChart(chart);
}
示例3: MinimalStaticChart
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* Defcon.
*/
private MinimalStaticChart() {
this.setLayout(new BorderLayout());
Chart2D chart = new Chart2D();
// 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:
double time = System.currentTimeMillis();
for (int i = 0; i < 120; i++) {
trace.addPoint(time + 1000 * 60 * i, i);
}
chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
chart.getAxisY().setPaintScale(false);
chart.getAxisX().setPaintScale(false);
// Make it visible:
this.add(new ChartPanel(chart), BorderLayout.CENTER);
}
示例4: 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;
}
示例5: 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);
}
示例6: main
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* Creates a zoomable chart with y axis log 10, simple label formatter, gridlines, acitvated highlighting and activated tooltips.
* <p>
*
* @param args
* ignored.
*/
public static void main(final String[] args) {
// Create a chart:
Chart2D chart = new ZoomableChart();
chart.setUseAntialiasing(true);
chart.setToolTipType(Chart2D.ToolTipType.VALUE_SNAP_TO_TRACEPOINTS);
chart.enablePointHighlighting(true);
// set a special axis:
AxisLog10<AxisScalePolicyTransformation> axisy = new AxisLog10<AxisScalePolicyTransformation>();
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(100);
chart.setAxisYLeft(axisy, 0);
axisy.setFormatter(new LabelFormatterSimple());
axisy.setPaintGrid(true);
chart.getAxisX().setPaintGrid(true);
// Create an ITrace:
ITrace2D trace = new Trace2DSimple();
// Add the trace to the chart:
chart.addTrace(trace);
trace.addPointHighlighter(new PointPainterDisc(10));
trace.setTracePainter(new TracePainterDisc(4));
trace.setColor(Color.BLUE);
trace.setStroke(new BasicStroke(1));
// Add the function 1/x + random
for (double i = 1; i <= 10; i += 0.1) {
trace.addPoint(i, Math.pow(10, i));
}
// Make it visible:
// Create a frame.
JFrame frame = new JFrame(Log10AxisChartZoomable.class.getName());
// add the chart to the frame:
frame.getContentPane().add(new ChartPanel(chart));
frame.setSize(400, 300);
// Enable the termination button [cross on the upper right edge]:
frame.addWindowListener(new WindowAdapter() {
/**
* @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
*/
@Override
public void windowClosing(final WindowEvent e) {
System.exit(0);
}
});
frame.setVisible(true);
}