本文整理汇总了Java中com.github.mikephil.charting.charts.ScatterChart.ScatterShape方法的典型用法代码示例。如果您正苦于以下问题:Java ScatterChart.ScatterShape方法的具体用法?Java ScatterChart.ScatterShape怎么用?Java ScatterChart.ScatterShape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.mikephil.charting.charts.ScatterChart
的用法示例。
在下文中一共展示了ScatterChart.ScatterShape方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateScatterData
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
protected ScatterData generateScatterData(int dataSets, float range, int count) {
ArrayList<IScatterDataSet> sets = new ArrayList<IScatterDataSet>();
ScatterChart.ScatterShape[] shapes = ScatterChart.ScatterShape.getAllDefaultShapes();
for(int i = 0; i < dataSets; i++) {
ArrayList<Entry> entries = new ArrayList<Entry>();
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;
}
示例2: getRendererForShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
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;
}
示例3: getRendererForShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
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;
}
示例4: generateScatterData
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* Generate scatter data scatter data.
*
* @param dataSets the data sets
* @param range the range
* @param count the count
* @return the scatter data
*/
protected ScatterData generateScatterData(int dataSets, float range, int count) {
ArrayList<IScatterDataSet> sets = new ArrayList<IScatterDataSet>();
ScatterChart.ScatterShape[] shapes = ScatterChart.ScatterShape.getAllDefaultShapes();
for(int i = 0; i < dataSets; i++) {
ArrayList<Entry> entries = new ArrayList<Entry>();
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;
}
示例5: getScatterShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
@Override
public ScatterChart.ScatterShape getScatterShape() {
return mScatterShape;
}
示例6: setScatterShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* 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);
}
示例7: setScatterShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* 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;
}
示例8: getScatterShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* Returns all the different scattershapes the chart uses
*
* @return
*/
ScatterChart.ScatterShape getScatterShape();
示例9: setScatterShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* 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();
}
示例10: setScatterShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* 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();
}
示例11: setScatterShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* Sets the ScatterShape this DataSet should be drawn with. This will search for an available ShapeRenderer and set this
* renderer for the DataSet.
*
* @param shape
*/
public void setScatterShape(ScatterChart.ScatterShape shape) {
ShapeRendererHandler handler = new ShapeRendererHandler();
mShapeRenderer = handler.getShapeRenderer(shape);
}
示例12: getShapeRenderer
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* Returns the corresponding ShapeRenderer for a given ScatterShape.
*
* @param shape
* @return
*/
public ShapeRenderer getShapeRenderer(ScatterChart.ScatterShape shape) {
return shapeRendererList.get(shape.toString());
}
示例13: setScatterShape
import com.github.mikephil.charting.charts.ScatterChart; //导入方法依赖的package包/类
/**
* Sets the shape that is drawn on the position where the values are at.
*
* @param shape
*/
public void setScatterShape(ScatterChart.ScatterShape shape) {
mScatterShape = shape;
}