本文整理汇总了Java中info.monitorenter.gui.chart.Chart2D.setGridColor方法的典型用法代码示例。如果您正苦于以下问题:Java Chart2D.setGridColor方法的具体用法?Java Chart2D.setGridColor怎么用?Java Chart2D.setGridColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类info.monitorenter.gui.chart.Chart2D
的用法示例。
在下文中一共展示了Chart2D.setGridColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ChartPanel
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
public ChartPanel(String... params) {
super(new BorderLayout());
int historySize = 200;
chart = new Chart2D();
chart.setBorder(new EmptyBorder(0,0,0,0));
//chart.setSize(200,200);
chart.setUseAntialiasing(true);
chart.setBackground(Color.BLACK);
chart.setForeground(Color.WHITE);
chart.setGridColor(Color.darkGray);
for (IAxis left : chart.getAxesYLeft()) {
left.setAxisTitle(new AxisTitle(""));
left.setPaintGrid(true);
}
for (IAxis bottom : chart.getAxesXBottom()) {
bottom.setVisible(false);
}
for (String p : params) {
Trace2DLtd t = new Trace2DLtd(historySize, p);
t.setColor(Color.getHSBColor( ((float)(p.hashCode()%1024))/1024.0f, 0.5f, 1.0f));
chart.addTrace(t);
this.params.put(p, t);
}
add(chart, BorderLayout.CENTER);
}
示例2: init
import info.monitorenter.gui.chart.Chart2D; //导入方法依赖的package包/类
/**
* @see java.applet.Applet#init()
*/
@Override
public void init() {
super.init();
Chart2D chart = new Chart2D();
this.setChart(chart);
this.setSize(new Dimension(600, 500));
this.m_chart.getAxisX().setPaintGrid(true);
this.m_chart.getAxisY().setPaintGrid(true);
chart.getAxisY().setRangePolicy(new RangePolicyMinimumViewport(new Range(-20, +20)));
chart.setGridColor(Color.LIGHT_GRAY);
this.setTrace(new Trace2DLtd(100));
this.getTrace().setName("random");
this.getTrace().setPhysicalUnits("Milliseconds", "random value");
this.getTrace().setColor(Color.RED);
chart.addTrace(this.getTrace());
Container content = this.getContentPane();
content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
LayoutFactory factory = LayoutFactory.getInstance();
ChartPanel chartpanel = new ChartPanel(chart);
this.setJMenuBar(factory.createChartMenuBar(chartpanel, false));
content.add(chartpanel);
content.addPropertyChangeListener(chartpanel);
this.setCollector(new RandomDataCollectorOffset(this.getTrace(), 50));
content.add(new ControlPanel());
}