// Path: lib/src/main/java/org/xclcharts/common/IFormatterDoubleCallBack.java
// public interface IFormatterDoubleCallBack {
// 	
// 	public String doubleFormatter(Double value);
// 	
// 	
// }
// 
// Path: lib/src/main/java/org/xclcharts/event/click/PointPosition.java
// public class PointPosition extends RectPosition {
// 		
// 	protected PointF mPoint = null;		
// 	
// 	public PointPosition()
// 	{	
// 	}
// 	
// 	public PointF getPosition()
// 	{
// 		return mPoint;
// 	}
// 	
// 	
// 	public String getPointInfo()
// 	{	
// 		if(null == mPoint)return "";
// 		String info = "x:"+Float.toString(mPoint.x)+" y:"+Float.toString(mPoint.y);
// 		return info;
// 	}
// 	
// }


import org.xclcharts.common.IFormatterDoubleCallBack;
import org.xclcharts.event.click.PointPosition;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
import android.util.Log;
/**
 * Copyright 2014  XCL-Charts
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 	
 * @Project XCL-Charts 
 * @Description Android图表基类库
 * @author XiongChuanLiang<br/>(xcl_168@aliyun.com)
 * @license http://www.apache.org/licenses/  Apache v2 License
 * @version 1.0
 */
package org.xclcharts.renderer;



/**
 * @ClassName RdChart
 * @Description  这是雷达图,极限图等图的基类
 * @author XiongChuanLiang<br/>(xcl_168@aliyun.com)
 *  
 */

public class RdChart extends EventChart {
	
	private String TAG = "RdChart";
	
	//半径
	private float mRadius=0.0f;	
	//初始偏移角度
	private int mOffsetAngle = 0;//180;		
					
	//格式化线中点的标签显示
	 private IFormatterDoubleCallBack mDotLabelFormatter;		
	 
	//开放标签和线画笔让用户设置
	private Paint mPaintLabel = null;	
	private Paint mPaintLine = null;
		
	
	public RdChart() {		
		
		//初始化图例
		if(null != plotLegend)
		{
			plotLegend.show();
			plotLegend.setType(XEnum.LegendType.ROW);
			plotLegend.setHorizontalAlign(XEnum.HorizontalAlign.CENTER);
			plotLegend.setVerticalAlign(XEnum.VerticalAlign.BOTTOM);
			plotLegend.showBox();
			plotLegend.hideBackground();
		}
				
	}
			
	@Override
	protected void calcPlotRange()
	{
		super.calcPlotRange();		
		this.mRadius = Math.min( div(this.plotArea.getWidth() ,2f) , 
				 				 div(this.plotArea.getHeight(),2f) );	
	}
	
	/**
	 * 返回当前点击点的信息
	 * @param x 点击点X坐标
	 * @param y	点击点Y坐标
	 * @return 返回对应的位置记录
	 */
// Path: lib/src/main/java/org/xclcharts/common/IFormatterDoubleCallBack.java
// public interface IFormatterDoubleCallBack {
// 	
// 	public String doubleFormatter(Double value);
// 	
// 	
// }
// 
// Path: lib/src/main/java/org/xclcharts/event/click/PointPosition.java
// public class PointPosition extends RectPosition {
// 		
// 	protected PointF mPoint = null;		
// 	
// 	public PointPosition()
// 	{	
// 	}
// 	
// 	public PointF getPosition()
// 	{
// 		return mPoint;
// 	}
// 	
// 	
// 	public String getPointInfo()
// 	{	
// 		if(null == mPoint)return "";
// 		String info = "x:"+Float.toString(mPoint.x)+" y:"+Float.toString(mPoint.y);
// 		return info;
// 	}
// 	
// }


// Path: lib/src/main/java/org/xclcharts/renderer/RdChart.java
import org.xclcharts.common.IFormatterDoubleCallBack;
import org.xclcharts.event.click.PointPosition;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
import android.util.Log;

/**
 * Copyright 2014  XCL-Charts
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 	
 * @Project XCL-Charts 
 * @Description Android图表基类库
 * @author XiongChuanLiang<br/>(xcl_168@aliyun.com)
 * @license http://www.apache.org/licenses/  Apache v2 License
 * @version 1.0
 */
package org.xclcharts.renderer;



/**
 * @ClassName RdChart
 * @Description  这是雷达图,极限图等图的基类
 * @author XiongChuanLiang<br/>(xcl_168@aliyun.com)
 *  
 */

public class RdChart extends EventChart {
	
	private String TAG = "RdChart";
	
	//半径
	private float mRadius=0.0f;	
	//初始偏移角度
	private int mOffsetAngle = 0;//180;		
					
	//格式化线中点的标签显示
	 private IFormatterDoubleCallBack mDotLabelFormatter;		
	 
	//开放标签和线画笔让用户设置
	private Paint mPaintLabel = null;	
	private Paint mPaintLine = null;
		
	
	public RdChart() {		
		
		//初始化图例
		if(null != plotLegend)
		{
			plotLegend.show();
			plotLegend.setType(XEnum.LegendType.ROW);
			plotLegend.setHorizontalAlign(XEnum.HorizontalAlign.CENTER);
			plotLegend.setVerticalAlign(XEnum.VerticalAlign.BOTTOM);
			plotLegend.showBox();
			plotLegend.hideBackground();
		}
				
	}
			
	@Override
	protected void calcPlotRange()
	{
		super.calcPlotRange();		
		this.mRadius = Math.min( div(this.plotArea.getWidth() ,2f) , 
				 				 div(this.plotArea.getHeight(),2f) );	
	}
	
	/**
	 * 返回当前点击点的信息
	 * @param x 点击点X坐标
	 * @param y	点击点Y坐标
	 * @return 返回对应的位置记录
	 */
	public PointPosition getPositionRecord(float x,float y)