An easy way to visualize in proportions any of your data.
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.github.maxViolet:ProportionsBarLibrary:0.1.1'
}
ProportionsBar proportionsBar = new ProportionsBar(context);
proportionsBar.setId(R.id.proportions_bar_1);
LinearLayout container = findViewById(R.id.container_pb);
container.addView(proportionsBar);
proportionsBar.addValues(11, 30.0, 24.21, -12.1, 41, 27.999);
*Where are can be less colors than number of values
proportionsBar.addColors(getResources().getColor(R.color.example1), getResources().getColor(R.color.example2),getResources().getColor(R.color.example3));
proportionsBar.addColors("#81DAF5", "#008db9", "#1c0a63")
Disable gaps (default value = true)
proportionsBar.showGaps(false);
Change the gaps' size (default is 1.0 in percent of view's width)
proportionsBar.gapSize(0.8);
Change the gaps' color (default is white)
proportionsBar.gapColor(Color.BLACK)
proportionsBar.gapColor("#ffffff");
Show rounded corners (default value = false)
proportionsBar.showRoundedCorners(true);
Change radius of the rounded corners (default value is 1.4)
proportionsBar.radiusRoundedCorners(3.5);