【仅供内部供应商使用,不提供对外解答和培训】
【仅供内部供应商使用,不提供对外解答和培训】
FineReport除了内置的图表、新特性图表插件外,还提供了第三方图表开发的API,方便进行个性化、第三方的图表开发。但是第三方图表API接口过于复杂,用户很难快速的实现并使用自己想使用的第三方新图表。
解决方法
在原有的图表接口基础之上,对接口进行了简化和修改,让用户可以快速的写出第三方图表插件并使用。
上述接口用户需要直接实现,里面具体需要实现的方法示例如下:
此接口用户不必实现 ,只需要继承实现了该接口的抽象类: AbstractIndependentChartUI4Custom 类即可,并实现相应方法,示例如下:
用户的图表配置面板ChartConfigPane类需要继承此抽象类,并实现相应的方法,示例如下:
package com.fr.chart.chartattr;
import com.fr.base.chart.BaseChartGlyph;
import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.ChangeConfigProvider;
import com.fr.base.chart.chartdata.ChartData;
import com.fr.chart.chartglyph.ChartGlyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.stable.web.Repository;
import java.awt.*;
import java.awt.geom.RectangularShape;
import java.util.Iterator;
import java.util.Map;
/**
* Created by mengao on 2017/5/3.
* 用户使用第三方图表需要继承chart父类
*/
public abstract class ThirdChart extends Chart implements BaseChartGlyph {
......
}
(2)ThirdChart
用户的图表配置面板ChartConfig类需要继承此抽象类,并实现
<extra-chart> |
|---|