• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IBubbleDataSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet的典型用法代码示例。如果您正苦于以下问题:Java IBubbleDataSet类的具体用法?Java IBubbleDataSet怎么用?Java IBubbleDataSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IBubbleDataSet类属于com.github.mikephil.charting.interfaces.datasets包,在下文中一共展示了IBubbleDataSet类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setData

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.where(RealmDemoData.class).findAll();

        RealmBubbleDataSet<RealmDemoData> set = new RealmBubbleDataSet<RealmDemoData>(result, "xValue", "yValue", "bubbleSize");
        set.setLabel("Realm BubbleDataSet");
        set.setColors(ColorTemplate.COLORFUL_COLORS, 110);

        ArrayList<IBubbleDataSet> dataSets = new ArrayList<IBubbleDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        BubbleData data = new BubbleData(dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:RealmDatabaseActivityBubble.java


示例2: calcMinMax

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
protected void calcMinMax() {
    super.calcMinMax();

    if (mDeltaX == 0 && mData.getYValCount() > 0)
        mDeltaX = 1;

    mXChartMin = -0.5f;
    mXChartMax = (float) mData.getXValCount() - 0.5f;

    if (mRenderer != null) {
        for (IBubbleDataSet set : mData.getDataSets()) {

            final float xmin = set.getXMin();
            final float xmax = set.getXMax();

            if (xmin < mXChartMin)
                mXChartMin = xmin;

            if (xmax > mXChartMax)
                mXChartMax = xmax;
        }
    }

    mDeltaX = Math.abs(mXChartMax - mXChartMin);
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:27,代码来源:BubbleChart.java


示例3: setData

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
private void setData() {

        RealmResults<RealmDemoData> result = mRealm.allObjects(RealmDemoData.class);

        RealmBubbleDataSet<RealmDemoData> set = new RealmBubbleDataSet<RealmDemoData>(result, "value", "xIndex", "bubbleSize");
        set.setLabel("Realm BubbleDataSet");
        set.setColors(ColorTemplate.COLORFUL_COLORS, 110);

        ArrayList<IBubbleDataSet> dataSets = new ArrayList<IBubbleDataSet>();
        dataSets.add(set); // add the dataset

        // create a data object with the dataset list
        RealmBubbleData data = new RealmBubbleData(result, "xValue", dataSets);
        styleData(data);

        // set data
        mChart.setData(data);
        mChart.animateY(1400, Easing.EasingOption.EaseInOutQuart);
    }
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:20,代码来源:RealmDatabaseActivityBubble.java


示例4: calcMinMax

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
protected void calcMinMax() {
    super.calcMinMax();

    if (mXAxis.mAxisRange == 0 && mData.getYValCount() > 0)
        mXAxis.mAxisRange = 1;

    mXAxis.mAxisMinimum = -0.5f;
    mXAxis.mAxisMaximum = (float) mData.getXValCount() - 0.5f;

    if (mRenderer != null) {
        for (IBubbleDataSet set : mData.getDataSets()) {

            final float xmin = set.getXMin();
            final float xmax = set.getXMax();

            if (xmin < mXAxis.mAxisMinimum)
                mXAxis.mAxisMinimum = xmin;

            if (xmax > mXAxis.mAxisMaximum)
                mXAxis.mAxisMaximum = xmax;
        }
    }

    mXAxis.mAxisRange = Math.abs(mXAxis.mAxisMaximum - mXAxis.mAxisMinimum);
}
 
开发者ID:pencil-box,项目名称:NetKnight,代码行数:27,代码来源:BubbleChart.java


示例5: drawData

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
public void drawData(Canvas c) {

    BubbleData bubbleData = mChart.getBubbleData();

    for (IBubbleDataSet set : bubbleData.getDataSets()) {

        if (set.isVisible())
            drawDataSet(c, set);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:BubbleChartRenderer.java


示例6: generateTransformedValuesBubble

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
/**
 * Transforms an List of Entry into a float array containing the x and
 * y values transformed with all matrices for the BUBBLECHART.
 *
 * @param data
 * @return
 */
public float[] generateTransformedValuesBubble(IBubbleDataSet data, float phaseY, int from, int to) {

    final int count = (to - from + 1) * 2; // (int) Math.ceil((to - from) * phaseX) * 2;

    if (valuePointsForGenerateTransformedValuesBubble.length != count) {
        valuePointsForGenerateTransformedValuesBubble = new float[count];
    }
    float[] valuePoints = valuePointsForGenerateTransformedValuesBubble;

    for (int j = 0; j < count; j += 2) {

        Entry e = data.getEntryForIndex(j / 2 + from);

        if (e != null) {
            valuePoints[j] = e.getX();
            valuePoints[j + 1] = e.getY() * phaseY;
        } else {
            valuePoints[j] = 0;
            valuePoints[j + 1] = 0;
        }
    }

    getValueToPixelMatrix().mapPoints(valuePoints);

    return valuePoints;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:34,代码来源:Transformer.java


示例7: calcMinMax

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
protected void calcMinMax() {
    super.calcMinMax();

    if (getBarData() != null || getCandleData() != null || getBubbleData() != null) {
        mXChartMin = -0.5f;
        mXChartMax = mData.getXVals().size() - 0.5f;

        if (getBubbleData() != null) {

            for (IBubbleDataSet set : getBubbleData().getDataSets()) {

                final float xmin = set.getXMin();
                final float xmax = set.getXMax();

                if (xmin < mXChartMin)
                    mXChartMin = xmin;

                if (xmax > mXChartMax)
                    mXChartMax = xmax;
            }
        }
    }

    mDeltaX = Math.abs(mXChartMax - mXChartMin);

    if (mDeltaX == 0.f && getLineData() != null && getLineData().getYValCount() > 0) {
        mDeltaX = 1.f;
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:31,代码来源:CombinedChart.java


示例8: drawData

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
public void drawData(Canvas c) {

    BubbleData bubbleData = mChart.getBubbleData();

    for (IBubbleDataSet set : bubbleData.getDataSets()) {

        if (set.isVisible() && set.getEntryCount() > 0)
            drawDataSet(c, set);
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:12,代码来源:BubbleChartRenderer.java


示例9: calcMinMax

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
protected void calcMinMax() {
    super.calcMinMax();

    if (getBarData() != null || getCandleData() != null || getBubbleData() != null) {
        mXAxis.mAxisMinimum = -0.5f;
        mXAxis.mAxisMaximum = mData.getXVals().size() - 0.5f;

        if (getBubbleData() != null) {

            for (IBubbleDataSet set : getBubbleData().getDataSets()) {

                final float xmin = set.getXMin();
                final float xmax = set.getXMax();

                if (xmin < mXAxis.mAxisMinimum)
                    mXAxis.mAxisMinimum = xmin;

                if (xmax > mXAxis.mAxisMaximum)
                    mXAxis.mAxisMaximum = xmax;
            }
        }
    }

    mXAxis.mAxisRange = Math.abs(mXAxis.mAxisMaximum - mXAxis.mAxisMinimum);

    if (mXAxis.mAxisRange == 0.f && getLineData() != null && getLineData().getYValCount() > 0) {
        mXAxis.mAxisRange = 1.f;
    }
}
 
开发者ID:pencil-box,项目名称:NetKnight,代码行数:31,代码来源:CombinedChart.java


示例10: drawData

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
public void drawData(Canvas c) {

    BubbleData bubbleData = mChart.getBubbleData();

    IBubbleDataSet set;
    List<IBubbleDataSet> dataSets = bubbleData.getDataSets();
    int setCount = dataSets.size();
    for (int i = 0; i < setCount; i++) {
        set = dataSets.get(i);

        if (set.isVisible())
            drawDataSet(c, set);
    }
}
 
开发者ID:letolab,项目名称:LETO-Toggl_Android,代码行数:16,代码来源:BubbleChartRenderer.java


示例11: BubbleData

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
public BubbleData(IBubbleDataSet... dataSets) {
    super(dataSets);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:BubbleData.java


示例12: drawHighlighted

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
public void drawHighlighted(Canvas c, Highlight[] indices) {

    BubbleData bubbleData = mChart.getBubbleData();

    float phaseY = mAnimator.getPhaseY();

    for (Highlight high : indices) {

        IBubbleDataSet set = bubbleData.getDataSetByIndex(high.getDataSetIndex());

        if (set == null || !set.isHighlightEnabled())
            continue;

        final BubbleEntry entry = set.getEntryForXValue(high.getX(), high.getY());

        if (entry.getY() != high.getY())
            continue;

        if (!isInBoundsX(entry, set))
            continue;

        Transformer trans = mChart.getTransformer(set.getAxisDependency());

        sizeBuffer[0] = 0f;
        sizeBuffer[2] = 1f;

        trans.pointValuesToPixel(sizeBuffer);

        boolean normalizeSize = set.isNormalizeSizeEnabled();

        // calcualte the full width of 1 step on the x-axis
        final float maxBubbleWidth = Math.abs(sizeBuffer[2] - sizeBuffer[0]);
        final float maxBubbleHeight = Math.abs(
                mViewPortHandler.contentBottom() - mViewPortHandler.contentTop());
        final float referenceSize = Math.min(maxBubbleHeight, maxBubbleWidth);

        pointBuffer[0] = entry.getX();
        pointBuffer[1] = (entry.getY()) * phaseY;
        trans.pointValuesToPixel(pointBuffer);

        high.setDraw(pointBuffer[0], pointBuffer[1]);

        float shapeHalf = getShapeSize(entry.getSize(),
                set.getMaxSize(),
                referenceSize,
                normalizeSize) / 2f;

        if (!mViewPortHandler.isInBoundsTop(pointBuffer[1] + shapeHalf)
                || !mViewPortHandler.isInBoundsBottom(pointBuffer[1] - shapeHalf))
            continue;

        if (!mViewPortHandler.isInBoundsLeft(pointBuffer[0] + shapeHalf))
            continue;

        if (!mViewPortHandler.isInBoundsRight(pointBuffer[0] - shapeHalf))
            break;

        final int originalColor = set.getColor((int) entry.getX());

        Color.RGBToHSV(Color.red(originalColor), Color.green(originalColor),
                Color.blue(originalColor), _hsvBuffer);
        _hsvBuffer[2] *= 0.5f;
        final int color = Color.HSVToColor(Color.alpha(originalColor), _hsvBuffer);

        mHighlightPaint.setColor(color);
        mHighlightPaint.setStrokeWidth(set.getHighlightCircleWidth());
        c.drawCircle(pointBuffer[0], pointBuffer[1], shapeHalf, mHighlightPaint);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:71,代码来源:BubbleChartRenderer.java


示例13: BubbleData

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
public BubbleData(List<String> xVals, List<IBubbleDataSet> dataSets) {
    super(xVals, dataSets);
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:4,代码来源:BubbleData.java


示例14: toList

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
private static List<IBubbleDataSet> toList(IBubbleDataSet dataSet) {
    List<IBubbleDataSet> sets = new ArrayList<IBubbleDataSet>();
    sets.add(dataSet);
    return sets;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:6,代码来源:BubbleData.java


示例15: RealmBubbleData

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
public RealmBubbleData(RealmResults<? extends RealmObject> result, String xValuesField, List<IBubbleDataSet> dataSets) {
    super(RealmUtils.toXVals(result, xValuesField), dataSets);
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:4,代码来源:RealmBubbleData.java


示例16: drawHighlighted

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
@Override
public void drawHighlighted(Canvas c, Highlight[] indices) {

    BubbleData bubbleData = mChart.getBubbleData();

    float phaseX = mAnimator.getPhaseX();
    float phaseY = mAnimator.getPhaseY();

    for (Highlight indice : indices) {

        IBubbleDataSet dataSet = bubbleData.getDataSetByIndex(indice.getDataSetIndex());

        if (dataSet == null || !dataSet.isHighlightEnabled())
            continue;

        BubbleEntry entryFrom = dataSet.getEntryForXIndex(mMinX);
        BubbleEntry entryTo = dataSet.getEntryForXIndex(mMaxX);

        int minx = dataSet.getEntryIndex(entryFrom);
        int maxx = Math.min(dataSet.getEntryIndex(entryTo) + 1, dataSet.getEntryCount());

        final BubbleEntry entry = (BubbleEntry) bubbleData.getEntryForHighlight(indice);
        if (entry == null || entry.getXIndex() != indice.getXIndex())
            continue;

        Transformer trans = mChart.getTransformer(dataSet.getAxisDependency());

        sizeBuffer[0] = 0f;
        sizeBuffer[2] = 1f;

        trans.pointValuesToPixel(sizeBuffer);

        // calcualte the full width of 1 step on the x-axis
        final float maxBubbleWidth = Math.abs(sizeBuffer[2] - sizeBuffer[0]);
        final float maxBubbleHeight = Math.abs(mViewPortHandler.contentBottom() - mViewPortHandler.contentTop());
        final float referenceSize = Math.min(maxBubbleHeight, maxBubbleWidth);

        pointBuffer[0] = (float) (entry.getXIndex() - minx) * phaseX + (float) minx;
        pointBuffer[1] = (float) (entry.getVal()) * phaseY;
        trans.pointValuesToPixel(pointBuffer);

        float shapeHalf = getShapeSize(entry.getSize(), dataSet.getMaxSize(), referenceSize) / 2f;

        if (!mViewPortHandler.isInBoundsTop(pointBuffer[1] + shapeHalf)
                || !mViewPortHandler.isInBoundsBottom(pointBuffer[1] - shapeHalf))
            continue;

        if (!mViewPortHandler.isInBoundsLeft(pointBuffer[0] + shapeHalf))
            continue;

        if (!mViewPortHandler.isInBoundsRight(pointBuffer[0] - shapeHalf))
            break;

        if (indice.getXIndex() < minx || indice.getXIndex() >= maxx)
            continue;

        final int originalColor = dataSet.getColor(entry.getXIndex());

        Color.RGBToHSV(Color.red(originalColor), Color.green(originalColor),
                Color.blue(originalColor), _hsvBuffer);
        _hsvBuffer[2] *= 0.5f;
        final int color = Color.HSVToColor(Color.alpha(originalColor), _hsvBuffer);

        mHighlightPaint.setColor(color);
        mHighlightPaint.setStrokeWidth(dataSet.getHighlightCircleWidth());
        c.drawCircle(pointBuffer[0], pointBuffer[1], shapeHalf, mHighlightPaint);
    }
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:69,代码来源:BubbleChartRenderer.java


示例17: generateTransformedValuesBubble

import com.github.mikephil.charting.interfaces.datasets.IBubbleDataSet; //导入依赖的package包/类
/**
 * Transforms an List of Entry into a float array containing the x and
 * y values transformed with all matrices for the BUBBLECHART.
 *
 * @param data
 * @return
 */
public float[] generateTransformedValuesBubble(IBubbleDataSet data,
                                               float phaseX, float phaseY, int from, int to) {

    final int count = (int) Math.ceil(to - from) * 2; // (int) Math.ceil((to - from) * phaseX) * 2;

    float[] valuePoints = new float[count];

    for (int j = 0; j < count; j += 2) {

        Entry e = data.getEntryForIndex(j / 2 + from);

        if (e != null) {
            valuePoints[j] = (float) (e.getXIndex() - from) * phaseX + from;
            valuePoints[j + 1] = e.getVal() * phaseY;
        }
    }

    getValueToPixelMatrix().mapPoints(valuePoints);

    return valuePoints;
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:29,代码来源:Transformer.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RtGithub类代码示例发布时间:2022-05-23
下一篇:
Java SerializableFunction类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap