本文整理汇总了Java中org.xclcharts.renderer.XEnum类的典型用法代码示例。如果您正苦于以下问题:Java XEnum类的具体用法?Java XEnum怎么用?Java XEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XEnum类属于org.xclcharts.renderer包,在下文中一共展示了XEnum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setLabelBoxStyle
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
/**
* 显示标签标识风格。默认为带箭头的标识框
* @param style 风格
*/
public void setLabelBoxStyle(XEnum.LabelBoxStyle style)
{
mLabelBoxStyle = style;
if(XEnum.LabelBoxStyle.TEXT == mLabelBoxStyle)
{
this.hideBorder();
this.hideBackground();
return;
}
if(XEnum.LabelBoxStyle.CIRCLE == mLabelBoxStyle)
{
this.hideBorder();
showBackground();
}else{
showBorder();
showBackground();
}
}
示例2: chartLnRender
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
private void chartLnRender()
{
try {
//设置绘图区默认缩进px值,留置空间显示Axis,Axistitle....
int [] ltrb = getBarLnDefaultSpadding();
lnChart.setPadding(ltrb[0], ltrb[1], ltrb[2], ltrb[3]);
renderLnAxis();
lnChart.getPlotLegend().show();
//允许线与轴交叉时,线会断开
lnChart.setLineAxisIntersectVisible(false);
lnChart.setXCoordFirstTickmarksBegin(true);
lnChart.setBarCenterStyle(XEnum.BarCenterStyle.TICKMARKS);
lnChart.getCategoryAxis().hideAxisLabels();
//lnChart.getPlotArea().setBackgroundColor(true, Color.BLUE);
} catch (Exception e) {
// TODO Auto-generated catch block
Log.e(TAG, e.toString());
}
}
示例3: renderLabels
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
protected boolean renderLabels(Canvas canvas)
{
if(null == mLstLabels) return false;
boolean showLabel = true;
if(mSaveLabelsPosition)
{
if( XEnum.LabelSaveType.ONLYPOSITION == mLabelSaveType ) showLabel = false;
}
int count = mLstLabels.size();
for(int i=0 ;i<count; i++ )
{
PlotArcLabelInfo info = mLstLabels.get(i);
renderLabel(canvas,mDataset.get(info.getID()),info,mSaveLabelsPosition,showLabel);
}
if(!mSaveLabelsPosition)mLstLabels.clear();
return true;
}
示例4: sortDataSet
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
private boolean sortDataSet()
{
if(null == mDataSet)
{
Log.e(TAG,"数据源为空!");
return false;
}
for(int i= mDataSet.size()- 1;i >= 0;i--)
{
FunnelData d = mDataSet.get(i);
if( Float.compare(d.getData(), 0.0f) == -1
|| Float.compare(d.getData(), 0.0f) == 0)
{
mDataSet.remove(i);
}
}
if( mDataSet.size() == 0) return false;
if( XEnum.SortType.NORMAL != mSortType)Collections.sort(mDataSet);
return true;
}
示例5: chartPieRender
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
private void chartPieRender()
{
try {
//标签显示(隐藏,显示在中间,显示在扇区外面)
chartPie.setLabelStyle(XEnum.SliceLabelStyle.INSIDE);
chartPie.getLabelPaint().setColor(Color.WHITE);
chartPie.setDataSource(chartDataPie);
chartPie.getPlotLegend().hide();
} catch (Exception e) {
// TODO Auto-generated catch block
Log.e(TAG, "chartPieRender():"+e.toString());
}
}
示例6: chartRender
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
public void chartRender()
{
try {
//设置附加信息
chart.setAttributeInfo(mDataInfo);
//半圆方式显示
chart.setCircleType(XEnum.CircleType.HALF);
//设置图表数据源
chart.setDataSource(mlPieData);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
示例7: drawClipCategoryAxisLine
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
@Override
protected void drawClipCategoryAxisLine(Canvas canvas)
{
if(XEnum.Direction.VERTICAL == mDirection &&
dataAxis.getAxisStdStatus() && categoryAxis.getAxisBuildStdStatus())
{
float y = getVPDataAxisStdY();
categoryAxis.renderAxis(canvas,plotArea.getLeft(), y, plotArea.getRight(), y);
}else if(XEnum.Direction.HORIZONTAL == mDirection &&
dataAxis.getAxisStdStatus() && categoryAxis.getAxisBuildStdStatus()){
float x = getHPDataAxisStdX();
categoryAxis.renderAxis(canvas,x, plotArea.getTop(), x, plotArea.getBottom());
}else{
super.drawClipCategoryAxisLine(canvas);
}
}
示例8: chartDataSet
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
private void chartDataSet()
{
//线1的数据集
List<PointD> linePoint1 = new ArrayList<PointD>();
linePoint1.add(new PointD(0d, 3d));
linePoint1.add(new PointD(1d, 9d));
linePoint1.add(new PointD(2d, 8d));
linePoint1.add(new PointD(3d, 7d));
linePoint1.add(new PointD(4d, 15d));
linePoint1.add(new PointD(5d, 16d));
SplineData dataSeries1 = new SplineData("Go",linePoint1,
Color.WHITE ); //Color.rgb(54, 141, 238)
//把线弄细点
dataSeries1.getLinePaint().setStrokeWidth(6);
dataSeries1.setLineStyle(XEnum.LineStyle.DASH);
dataSeries1.setLabelVisible(false);
dataSeries1.setDotStyle(XEnum.DotStyle.RING);
dataSeries1.getDotPaint().setColor(Color.rgb(30, 179, 143));
dataSeries1.getPlotLine().getPlotDot().setRingInnerColor(Color.WHITE);//
chartData.add(dataSeries1);
}
示例9: defaultAxisSetting
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
/**
* 图为横向或竖向时,轴和Bar的默认显示风格
*/
protected void defaultAxisSetting()
{
if(null == mDirection) return;
categoryAxisDefaultSetting();
dataAxisDefaultSetting();
if(null != getBar())
{
switch (mDirection) {
case HORIZONTAL:
getBar().getItemLabelPaint().setTextAlign(Align.LEFT);
getBar().setBarDirection(XEnum.Direction.HORIZONTAL);
break;
case VERTICAL:
getBar().setBarDirection(XEnum.Direction.VERTICAL);
break;
}
}
}
示例10: chartDataSet
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
private void chartDataSet()
{
//将标签与对应的数据集分别绑定
//标签对应的数据集
List<Double> dataSeries1= new LinkedList<Double>();
double testData[] = {40,21,32,56,40,54,46,32,89,76,53,62,66,78,47,53,90,80,60,82,77,67,79,85,83,90} ;
for(int i=0;i< testData.length;i++){
dataSeries1.add( testData[i]);
mLabels.add( Integer.toString(i));
}
//设置每条线各自的显示属性
//key,数据集,线颜色,区域颜色
AreaData line1 = new AreaData("小熊",dataSeries1,Color.rgb(108, 180, 223),Color.YELLOW);
//不显示点
line1.setDotStyle(XEnum.DotStyle.HIDE);
line1.setApplayGradient(true);
line1.setAreaBeginColor(Color.WHITE);
line1.setAreaEndColor(Color.rgb(108, 180, 223));
line1.setGradientDirection(XEnum.Direction.VERTICAL);
mDataset.add(line1);
}
示例11: renderPlotOne
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
private void renderPlotOne(Canvas canvas,float cx,float funnelWidth,float funnelHeight)
{
FunnelData d = mDataSet.get(0);
float halfWidth = getHalfWidth(funnelWidth,d.getData());
PointF pStart = new PointF();
PointF pStop = new PointF();
pStart.x = cx - halfWidth;
pStop.x = cx + halfWidth;
if(XEnum.SortType.DESC == mSortType)
{
pStart.y = pStop.y = plotArea.getTop();
}else{
pStart.y = pStop.y = plotArea.getBottom();
}
if(d.getAlpha() != -1)getPaint().setAlpha(d.getAlpha());
drawTriangle(canvas,cx, pStart,pStop );
if(d.getAlpha() != -1)getPaint().setAlpha(255);
float labelY = plotArea.getBottom() - plotArea.getHeight()/2;
renderLabels(canvas,d.getLabel(),cx, labelY,d.getColor());
return ;
}
示例12: drawLine
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
public void drawLine(XEnum.LineStyle style,
float startX,float startY,
float stopX,float stopY,
Canvas canvas,
Paint paint
)
{
switch(style)
{
case SOLID:
canvas.drawLine(startX, startY, stopX, stopY, paint);
break;
case DOT:
drawDotLine(startX, startY, stopX, stopY, canvas,paint);
break;
case DASH:
//虚实线
drawDashLine(startX, startY, stopX, stopY, canvas,paint);
break;
}
}
示例13: chartCustomeLines
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
/**
* 期望线/分界线
*/
private void chartCustomeLines() {
CustomLineData cdx1 = new CustomLineData("稍好", 30d, Color.rgb(35, 172,
57), 5);
CustomLineData cdx2 = new CustomLineData("舒适", 40d, Color.rgb(69, 181,
248), 5);
cdx1.setLabelVerticalAlign(XEnum.VerticalAlign.MIDDLE);
mXCustomLineDataset.add(cdx1);
mXCustomLineDataset.add(cdx2);
CustomLineData cdy1 = new CustomLineData("定制线", 45d, Color.rgb(69, 181,
248), 5);
cdy1.setLabelHorizontalPostion(Align.CENTER);
mYCustomLineDataset.add(cdy1);
}
示例14: initChart
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
private void initChart(int chartStyle)
{
switch (chartStyle)
{
case 0: // Vertical bar char
mChart = new BarChart();
// mChart.getAxisTitle().setLeftTitle("24 Hours Results");
break;
case 1: // Horizontal bar chart
mChart = new BarChart();
mChart.setChartDirection(XEnum.Direction.HORIZONTAL);
break;
case 2: // Vertical 3D bar char
mChart = new BarChart3D();
break;
case 3: // Horizontal 3D bar chart
mChart = new BarChart3D();
mChart.setChartDirection(XEnum.Direction.HORIZONTAL);
break;
case 4: // Vertical stack bar char
mChart = new StackBarChart();
((StackBarChart) mChart).setTotalLabelVisible(false);
break;
case 5: // Horizontal stack bar chart
mChart = new StackBarChart();
mChart.setChartDirection(XEnum.Direction.HORIZONTAL);
((StackBarChart) mChart).setTotalLabelVisible(false);
break;
}
}
示例15: chartRender
import org.xclcharts.renderer.XEnum; //导入依赖的package包/类
private void chartRender()
{
try {
//设置绘图区默认缩进px值,留置空间显示Axis,Axistitle....
int [] ltrb = getBarLnDefaultSpadding();
chart.setPadding(ltrb[0],ltrb[1], ltrb[2], ltrb[3]);
//标题
chart.setTitle("营销漏斗");
chart.addSubtitle("(XCL-Charts Demo)");
//数据源
chart.setDataSource(chartData);
chart.showBorder();
chart.setSortType(XEnum.SortType.DESC);
//chart.setSortType(XEnum.SortType.ASC);
chart.setLabelAlign(XEnum.HorizontalAlign.LEFT);
chart.syncLabelLineColor();
chart.setPlotWidthPercent(60.f);
chart.getFunnelLinePaint().setColor(Color.WHITE);
chart.getLabelPaint().setTextSize(18);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}