use of com.db.chart.model.LineSet in project WilliamChart by diogobernardino.
the class LineCardThree method show.
@Override
public void show(Runnable action) {
super.show(action);
LineSet dataset = new LineSet(mLabels, mValues[0]);
dataset.setColor(Color.parseColor("#53c1bd")).setFill(Color.parseColor("#3d6c73")).setGradientFill(new int[] { Color.parseColor("#364d5a"), Color.parseColor("#3f7178") }, null);
mChart.addData(dataset);
mChart.show(new Animation().withEndAction(action));
}
use of com.db.chart.model.LineSet in project WilliamChart by diogobernardino.
the class LineCardTwo method show.
@Override
public void show(Runnable action) {
super.show(action);
LineSet dataset = new LineSet(mLabels, mValues[0]);
dataset.setColor(Color.parseColor("#004f7f")).setThickness(Tools.fromDpToPx(3)).setSmooth(true).beginAt(4).endAt(36);
for (int i = 0; i < mLabels.length; i += 5) {
Point point = (Point) dataset.getEntry(i);
point.setColor(Color.parseColor("#ffffff"));
point.setStrokeColor(Color.parseColor("#0290c3"));
if (i == 30 || i == 10)
point.setRadius(Tools.fromDpToPx(6));
}
mChart.addData(dataset);
Paint thresPaint = new Paint();
thresPaint.setColor(Color.parseColor("#0079ae"));
thresPaint.setStyle(Paint.Style.STROKE);
thresPaint.setAntiAlias(true);
thresPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
thresPaint.setPathEffect(new DashPathEffect(new float[] { 10, 10 }, 0));
Paint gridPaint = new Paint();
gridPaint.setColor(Color.parseColor("#ffffff"));
gridPaint.setStyle(Paint.Style.STROKE);
gridPaint.setAntiAlias(true);
gridPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
mChart.setXLabels(AxisRenderer.LabelPosition.OUTSIDE).setYLabels(AxisRenderer.LabelPosition.NONE).setGrid(0, 7, gridPaint).setValueThreshold(80f, 80f, thresPaint).setAxisBorderValues(0, 110).show(new Animation().fromXY(0, .5f).withEndAction(action));
}
use of com.db.chart.model.LineSet in project WilliamChart by diogobernardino.
the class LineFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View layout = inflater.inflate(R.layout.fragment_line, container, false);
mChart = (LineChartView) layout.findViewById(R.id.chart);
mFirstStage = true;
layout.setOnClickListener(this);
mChart.setOnClickListener(this);
LineSet dataset = new LineSet(mLabels, mValues[0]);
dataset.setColor(Color.parseColor("#004f7f")).setThickness(Tools.fromDpToPx(3)).setSmooth(true).beginAt(4).endAt(36);
for (int i = 0; i < mLabels.length; i += 5) {
Point point = (Point) dataset.getEntry(i);
point.setColor(Color.parseColor("#ffffff"));
point.setStrokeColor(Color.parseColor("#0290c3"));
if (i == 30 || i == 10)
point.setRadius(Tools.fromDpToPx(6));
}
mChart.addData(dataset);
Paint thresPaint = new Paint();
thresPaint.setColor(Color.parseColor("#0079ae"));
thresPaint.setStyle(Paint.Style.STROKE);
thresPaint.setAntiAlias(true);
thresPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
thresPaint.setPathEffect(new DashPathEffect(new float[] { 10, 10 }, 0));
Paint gridPaint = new Paint();
gridPaint.setColor(Color.parseColor("#ffffff"));
gridPaint.setStyle(Paint.Style.STROKE);
gridPaint.setAntiAlias(true);
gridPaint.setStrokeWidth(Tools.fromDpToPx(.75f));
mChart.setBorderSpacing((int) Tools.fromDpToPx(0)).setXLabels(AxisRenderer.LabelPosition.OUTSIDE).setLabelsColor(Color.parseColor("#304a00")).setYLabels(AxisRenderer.LabelPosition.NONE).setXAxis(false).setYAxis(false).setGrid(1, 7, gridPaint).setValueThreshold(80f, 80f, thresPaint).setAxisBorderValues(0, 110);
mChart.show(new Animation().fromXY(0, .5f));
return layout;
}
Aggregations