Skip to content

Commit

Permalink
AndroidUI 1.0.2ii
Browse files Browse the repository at this point in the history
  • Loading branch information
Petersburg2020 committed Mar 24, 2023
1 parent 1b49208 commit 76713a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package nx.peter.app.android_ui.view;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import com.github.mikephil.charting.charts.BarChart;
Expand Down Expand Up @@ -35,12 +36,6 @@ protected void init(AttributeSet attrs) {
protected void reset() {
super.reset();

setTitle("Shapes");
setColorSwatch(ColorSwatch.Material);
addData("Square", 0.7f, 1.5f);
addData("Circle", 0.8f, 2.5f);
addData("Rectangle", 0.6f, 1.8f);

// chart.animateXY(0,0, Easing.EaseInBounce);
}

Expand All @@ -62,8 +57,18 @@ public void addData(@NonNull CharSequence label, float valueX, float valueY) {
@Override
protected void setup() {
dataSet = new BarDataSet(getData().getEntries(), getTitle());
chart.setData(new BarData(dataSet));
BarData data = new BarData(dataSet);
data.setBarWidth(20f);
data.setDrawValues(true);

chart.setData(data);
dataSet.setColors(getColor(color));
dataSet.setBarBorderWidth(2);
dataSet.setValueTextSize(16f);
dataSet.setValueTextColor(Color.BLACK);


chart.getDescription().setEnabled(false);
chart.animateXY(animateX, animateY, getEase(animator));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ protected void init(AttributeSet attrs) {
protected void reset() {
super.reset();

setTitle("Shapes");
setColorSwatch(ColorSwatch.Vordiplom);
addData("Square", 45);
addData("Circle", 25);
addData("Rectangle", 78);
}

@Override
Expand Down Expand Up @@ -120,7 +115,8 @@ public PiList(List<PiData> data) {
@Override
public List<PieEntry> getEntries() {
List<PieEntry> p = new ArrayList<>();
for (PiData d : data) p.add(new PieEntry(d.getValue1(), d.getLabel()));
for (PiData d : data)
p.add(new PieEntry(d.getValue1(), d.getLabel()));
return p;
}
}
Expand Down

0 comments on commit 76713a8

Please sign in to comment.