Java Code Examples for com.github.mikephil.charting.charts.ScatterChart#ScatterShape

The following examples show how to use com.github.mikephil.charting.charts.ScatterChart#ScatterShape . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScatterDataSet.java    From StockChart-MPAndroidChart with MIT License 6 votes vote down vote up
public static IShapeRenderer getRendererForShape(ScatterChart.ScatterShape shape) {

        switch (shape) {
            case SQUARE:
                return new SquareShapeRenderer();
            case CIRCLE:
                return new CircleShapeRenderer();
            case TRIANGLE:
                return new TriangleShapeRenderer();
            case CROSS:
                return new CrossShapeRenderer();
            case X:
                return new XShapeRenderer();
            case CHEVRON_UP:
                return new ChevronUpShapeRenderer();
            case CHEVRON_DOWN:
                return new ChevronDownShapeRenderer();
        }

        return null;
    }
 
Example 2
Source File: SimpleFragment.java    From StockChart-MPAndroidChart with MIT License 6 votes vote down vote up
protected ScatterData generateScatterData(int dataSets, float range, int count) {

        ArrayList<IScatterDataSet> sets = new ArrayList<>();

        ScatterChart.ScatterShape[] shapes = ScatterChart.ScatterShape.getAllDefaultShapes();

        for(int i = 0; i < dataSets; i++) {

            ArrayList<Entry> entries = new ArrayList<>();

            for(int j = 0; j < count; j++) {
                entries.add(new Entry(j, (float) (Math.random() * range) + range / 4));
            }

            ScatterDataSet ds = new ScatterDataSet(entries, getLabel(i));
            ds.setScatterShapeSize(12f);
            ds.setScatterShape(shapes[i % shapes.length]);
            ds.setColors(ColorTemplate.COLORFUL_COLORS);
            ds.setScatterShapeSize(9f);
            sets.add(ds);
        }

        ScatterData d = new ScatterData(sets);
        d.setValueTypeface(tf);
        return d;
    }
 
Example 3
Source File: RealmScatterDataSet.java    From MPAndroidChart-Realm with Apache License 2.0 6 votes vote down vote up
public static IShapeRenderer getRendererForShape(ScatterChart.ScatterShape shape) {

        switch (shape) {
            case SQUARE:
                return new SquareShapeRenderer();
            case CIRCLE:
                return new CircleShapeRenderer();
            case TRIANGLE:
                return new TriangleShapeRenderer();
            case CROSS:
                return new CrossShapeRenderer();
            case X:
                return new XShapeRenderer();
            case CHEVRON_UP:
                return new ChevronUpShapeRenderer();
            case CHEVRON_DOWN:
                return new ChevronDownShapeRenderer();
        }

        return null;
    }
 
Example 4
Source File: ScatterDataSet.java    From Ticket-Analysis with MIT License 5 votes vote down vote up
public static IShapeRenderer getRendererForShape(ScatterChart.ScatterShape shape) {

        switch (shape) {
            case SQUARE: return new SquareShapeRenderer();
            case CIRCLE: return new CircleShapeRenderer();
            case TRIANGLE: return new TriangleShapeRenderer();
            case CROSS: return new CrossShapeRenderer();
            case X: return new XShapeRenderer();
            case CHEVRON_UP: return new ChevronUpShapeRenderer();
            case CHEVRON_DOWN: return new ChevronDownShapeRenderer();
        }

        return null;
    }
 
Example 5
Source File: ScatterDataSet.java    From android-kline with Apache License 2.0 5 votes vote down vote up
public static IShapeRenderer getRendererForShape(ScatterChart.ScatterShape shape) {

        switch (shape) {
            case SQUARE: return new SquareShapeRenderer();
            case CIRCLE: return new CircleShapeRenderer();
            case TRIANGLE: return new TriangleShapeRenderer();
            case CROSS: return new CrossShapeRenderer();
            case X: return new XShapeRenderer();
            case CHEVRON_UP: return new ChevronUpShapeRenderer();
            case CHEVRON_DOWN: return new ChevronDownShapeRenderer();
        }

        return null;
    }
 
Example 6
Source File: RealmScatterDataSet.java    From Stayfit with Apache License 2.0 4 votes vote down vote up
@Override
public ScatterChart.ScatterShape getScatterShape() {
    return mScatterShape;
}
 
Example 7
Source File: ScatterDataSet.java    From StockChart-MPAndroidChart with MIT License 2 votes vote down vote up
/**
 * Sets the ScatterShape this DataSet should be drawn with. This will search for an available IShapeRenderer and set this
 * renderer for the DataSet.
 *
 * @param shape
 */
public void setScatterShape(ScatterChart.ScatterShape shape) {
    mShapeRenderer = getRendererForShape(shape);
}
 
Example 8
Source File: ScatterDataSet.java    From Ticket-Analysis with MIT License 2 votes vote down vote up
/**
 * Sets the ScatterShape this DataSet should be drawn with. This will search for an available IShapeRenderer and set this
 * renderer for the DataSet.
 *
 * @param shape
 */
public void setScatterShape(ScatterChart.ScatterShape shape) {
    mShapeRenderer = getRendererForShape(shape);
}
 
Example 9
Source File: ScatterDataSet.java    From android-kline with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the ScatterShape this DataSet should be drawn with. This will search for an available IShapeRenderer and set this
 * renderer for the DataSet.
 *
 * @param shape
 */
public void setScatterShape(ScatterChart.ScatterShape shape) {
    mShapeRenderer = getRendererForShape(shape);
}
 
Example 10
Source File: RealmScatterDataSet.java    From Stayfit with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the shape that is drawn on the position where the values are at. If
 * "CUSTOM" is chosen, you need to call setCustomScatterShape(...) and
 * provide a path object that is drawn as the custom scattershape.
 *
 * @param shape
 */
public void setScatterShape(ScatterChart.ScatterShape shape) {
    mScatterShape = shape;
}
 
Example 11
Source File: IScatterDataSet.java    From Stayfit with Apache License 2.0 2 votes vote down vote up
/**
 * Returns all the different scattershapes the chart uses
 *
 * @return
 */
ScatterChart.ScatterShape getScatterShape();
 
Example 12
Source File: ScatterDataSet.java    From NetKnight with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the shapeIdentifier that this DataSet should be drawn with.
 * Make sure the ScatterChart has a renderer capable of rendering the provided identifier.
 *
 * @param shape
 */
public void setScatterShape(ScatterChart.ScatterShape shape) {
    mScatterShape = shape.toString();
}
 
Example 13
Source File: RealmScatterDataSet.java    From NetKnight with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the shape that is drawn on the position where the values are at.
 *
 * @param shape
 */
public void setScatterShape(ScatterChart.ScatterShape shape) {
    mScatterShape = shape.toString();
}
 
Example 14
Source File: RealmScatterDataSet.java    From MPAndroidChart-Realm with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the ScatterShape this DataSet should be drawn with. This will search for an available IShapeRenderer and set this
 * renderer for the DataSet.
 *
 * @param shape
 */
public void setScatterShape(ScatterChart.ScatterShape shape) {
    mShapeRenderer = getRendererForShape(shape);
}