⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 barcharttooltip.java

📁 一个完整的
💻 JAVA
字号:
package cn.com.fcsoft.chart.examples;
import cn.com.fcsoft.chart.*;

import java.awt.*;
import java.awt.event.*;


/**
 * This example shows how to use the floating value and bar labels.
 * @author meiqi.
 */
public class BarChartTooltip {

	public static void main(String[] argv) {
		// create the chart
		double[] values = new double[10];
		String[] labels = new String[values.length];
		for (int i = 0; i < values.length; i++) {
			values[i] = Math.round(Math.random()*100);
			labels[i] = "bar" + i;
		}
		BarChart chart = new BarChart();
		chart.setSampleCount(values.length);
		chart.setSampleValues(0, values);
		chart.setSampleLabels(labels);
		chart.setRelativeRange(1.0, 100);
		
		// turn on the floating value labels
		chart.setValueLabelsOn(true);
		chart.setValueLabelStyle(BarChart.VALUE_LABELS_FLOATING);
		chart.setBarLabelsOn(true);
		chart.setBarLabelStyle(BarChart.BAR_LABELS_FLOATING);

		// display the chart
		NonFlickerPanel p = new NonFlickerPanel(new BorderLayout());
		p.add("Center", chart);
		Frame f = new Frame();
		f.add("Center", p);
		f.setSize(400,300);
		f.show();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -