当前位置: 首页>>代码示例>>Java>>正文


Java IBarDataSet.isStacked方法代码示例

本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.IBarDataSet.isStacked方法的典型用法代码示例。如果您正苦于以下问题:Java IBarDataSet.isStacked方法的具体用法?Java IBarDataSet.isStacked怎么用?Java IBarDataSet.isStacked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.mikephil.charting.interfaces.datasets.IBarDataSet的用法示例。


在下文中一共展示了IBarDataSet.isStacked方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getHighlight

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public Highlight getHighlight(float x, float y) {
    Highlight high = super.getHighlight(x, y);

    if(high == null) {
        return null;
    }

    MPPointD pos = getValsForTouch(x, y);

    BarData barData = mChart.getBarData();

    IBarDataSet set = barData.getDataSetByIndex(high.getDataSetIndex());
    if (set.isStacked()) {

        return getStackedHighlight(high,
                set,
                (float) pos.x,
                (float) pos.y);
    }

    MPPointD.recycleInstance(pos);

    return high;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:BarHighlighter.java

示例2: getHighlight

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public Highlight getHighlight(float x, float y) {

	BarData barData = mChart.getBarData();

	MPPointD pos = getValsForTouch(y, x);

	Highlight high = getHighlightForX((float) pos.y, y, x);
	if (high == null)
		return null;

	IBarDataSet set = barData.getDataSetByIndex(high.getDataSetIndex());
	if (set.isStacked()) {

		return getStackedHighlight(high,
				set,
				(float) pos.y,
				(float) pos.x);
	}

	MPPointD.recycleInstance(pos);

	return high;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:HorizontalBarHighlighter.java

示例3: getHighlight

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public Highlight getHighlight(float x, float y) {

	Highlight h = super.getHighlight(x, y);

	if (h == null)
		return h;
	else {

		IBarDataSet set = mChart.getBarData().getDataSetByIndex(h.getDataSetIndex());

		if (set.isStacked()) {

			// create an array of the touch-point
			float[] pts = new float[2];
			pts[1] = y;

			// take any transformer to determine the x-axis value
			mChart.getTransformer(set.getAxisDependency()).pixelsToValue(pts);

			return getStackedHighlight(h, set, h.getXIndex(), h.getDataSetIndex(), pts[1]);
		} else
			return h;
	}
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:26,代码来源:BarHighlighter.java

示例4: getHighlight

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public Highlight getHighlight(float x, float y) {

	Highlight h = super.getHighlight(x, y);

	if (h == null)
		return h;
	else {

		IBarDataSet set = mChart.getBarData().getDataSetByIndex(h.getDataSetIndex());

		if (set.isStacked()) {

			// create an array of the touch-point
			float[] pts = new float[2];
			pts[0] = y;

			// take any transformer to determine the x-axis value
			mChart.getTransformer(set.getAxisDependency()).pixelsToValue(pts);

			return getStackedHighlight(h, set, h.getXIndex(), h.getDataSetIndex(), pts[0]);
		} else
			return h;
	}
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:26,代码来源:HorizontalBarHighlighter.java

示例5: initBuffers

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public void initBuffers() {

    BarData barData = mChart.getBarData();
    mBarBuffers = new BarBuffer[barData.getDataSetCount()];

    for (int i = 0; i < mBarBuffers.length; i++) {
        IBarDataSet set = barData.getDataSetByIndex(i);
        mBarBuffers[i] = new BarBuffer(set.getEntryCount() * 4 * (set.isStacked() ? set.getStackSize() : 1),
                barData.getDataSetCount(), set.isStacked());
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:BarChartRenderer.java

示例6: initBuffers

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public void initBuffers() {

    BarData barData = mChart.getBarData();
    mBarBuffers = new HorizontalBarBuffer[barData.getDataSetCount()];

    for (int i = 0; i < mBarBuffers.length; i++) {
        IBarDataSet set = barData.getDataSetByIndex(i);
        mBarBuffers[i] = new HorizontalBarBuffer(set.getEntryCount() * 4 * (set.isStacked() ? set.getStackSize() : 1),
                barData.getDataSetCount(), set.isStacked());
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:HorizontalBarChartRenderer.java

示例7: initBuffers

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public void initBuffers() {

    BarData barData = mChart.getBarData();
    mBarBuffers = new BarBuffer[barData.getDataSetCount()];

    for (int i = 0; i < mBarBuffers.length; i++) {
        IBarDataSet set = barData.getDataSetByIndex(i);
        mBarBuffers[i] = new BarBuffer(set.getEntryCount() * 4 * (set.isStacked() ? set.getStackSize() : 1),
                barData.getGroupSpace(),
                barData.getDataSetCount(), set.isStacked());
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:14,代码来源:BarChartRenderer.java

示例8: initBuffers

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public void initBuffers() {

    BarData barData = mChart.getBarData();
    mBarBuffers = new HorizontalBarBuffer[barData.getDataSetCount()];

    for (int i = 0; i < mBarBuffers.length; i++) {
        IBarDataSet set = barData.getDataSetByIndex(i);
        mBarBuffers[i] = new HorizontalBarBuffer(set.getEntryCount() * 4 * (set.isStacked() ? set.getStackSize() : 1),
                barData.getGroupSpace(),
                barData.getDataSetCount(), set.isStacked());
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:14,代码来源:HorizontalBarChartRenderer.java

示例9: getHighlight

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public Highlight getHighlight(float x, float y) {

	BarData barData = mChart.getBarData();

	final int xIndex = getXIndex(x);
	final float baseNoSpace = getBase(x);
	final int setCount = barData.getDataSetCount();
	int dataSetIndex = ((int)baseNoSpace) % setCount;

	if (dataSetIndex < 0) {
		dataSetIndex = 0;
	} else if (dataSetIndex >= setCount) {
		dataSetIndex = setCount - 1;
	}

	SelectionDetail selectionDetail = getSelectionDetail(xIndex, y, dataSetIndex);
	if (selectionDetail == null)
		return null;

	IBarDataSet set = barData.getDataSetByIndex(dataSetIndex);
	if (set.isStacked()) {

		float[] pts = new float[2];
		pts[1] = y;

		// take any transformer to determine the x-axis value
		mChart.getTransformer(set.getAxisDependency()).pixelsToValue(pts);

		return getStackedHighlight(selectionDetail,
				set,
				xIndex,
				pts[1]);
	}

	return new Highlight(
			xIndex,
			selectionDetail.value,
			selectionDetail.dataIndex,
			selectionDetail.dataSetIndex,
			-1);
}
 
开发者ID:pencil-box,项目名称:NetKnight,代码行数:43,代码来源:BarHighlighter.java

示例10: getHighlight

import com.github.mikephil.charting.interfaces.datasets.IBarDataSet; //导入方法依赖的package包/类
@Override
public Highlight getHighlight(float x, float y) {

	BarData barData = mChart.getBarData();

	final int xIndex = getXIndex(x);
	final float baseNoSpace = getBase(x);
	final int setCount = barData.getDataSetCount();
	int dataSetIndex = ((int)baseNoSpace) % setCount;

	if (dataSetIndex < 0) {
		dataSetIndex = 0;
	} else if (dataSetIndex >= setCount) {
		dataSetIndex = setCount - 1;
	}

	SelectionDetail selectionDetail = getSelectionDetail(xIndex, y, dataSetIndex);
	if (selectionDetail == null)
		return null;

	IBarDataSet set = barData.getDataSetByIndex(dataSetIndex);
	if (set.isStacked()) {

		float[] pts = new float[2];
		pts[0] = y;

		// take any transformer to determine the x-axis value
		mChart.getTransformer(set.getAxisDependency()).pixelsToValue(pts);

		return getStackedHighlight(selectionDetail,
				set,
				xIndex,
				pts[0]);
	}

	return new Highlight(
			xIndex,
			selectionDetail.value,
			selectionDetail.dataIndex,
			selectionDetail.dataSetIndex,
			-1);
}
 
开发者ID:pencil-box,项目名称:NetKnight,代码行数:43,代码来源:HorizontalBarHighlighter.java


注:本文中的com.github.mikephil.charting.interfaces.datasets.IBarDataSet.isStacked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。