Jfreechart资金曲线图

本文展示了如何使用Jfreechart 1.0.19创建一个资金曲线分析图,包括日期和价格数据。图表支持鼠标滑动,当鼠标移动时会显示当前点的日期、价格和资金信息,并动态更新图表标题。
摘要由CSDN通过智能技术生成
Jfreechart版本1.0.19,实现效果 — 鼠标滑动显示横纵坐标线,标题显示鼠标当前点对应的数据。
import java.awt.Font;
import java.text.DecimalFormat;
import java.util.Date;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.StandardChartTheme;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.axis.NumberTickUnit;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer;
import org.jfree.data.time.Day;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.xy.XYDataset;
import org.jfree.ui.ApplicationFrame;
import org.jfree.ui.RectangleEdge;
import org.jfree.ui.RefineryUtilities;

import com.fda.fc.chart.GraphPanel;
import com.fda.fc.utils.DateUtils;

public class GraphChartDemo extends ApplicationFrame {

	private static final long serialVersionUID = 6034161131043097089L;

	private static final String FRAME_NAME = "资金曲线分析图";

	private String varietyCode = "RB";

	public GraphChartDemo() {
		super(FRAME_NAME);
		try {
			JFreeChart chart = createChart();
			ChartPanel panel = new GraphPanel(chart, varietyCode);
			// panel = new ChartPanel(chart);
			// panel.setHorizontalAxisTrace(true);
			// panel.setVerticalAxisTrace(true);
			// panel.setDomainZoomable(true);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值