本文整理汇总了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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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);
}
示例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);
}