intrudershanky / scatter-piechart Goto Github PK
View Code? Open in Web Editor NEWEasy and simple implementation of PieChart with Scatter
Easy and simple implementation of PieChart with Scatter
hello,Tks the chart,when i use it, the datas is from network, the chart can't work right, then i modify the onMesure() ,please verify the problem.
@OverRide
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
float width = getMeasuredWidth();
float height = getMeasuredHeight();
side = Math.min(width, height);
cx = width / 2;
cy = height / 2;
paint.setColor(centerColor);
}
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
if (CollectionUtils.isEmpty(chartUtils)) {
if (chartData != null) {
if (withPercent) {
float value = 0;
int i;
for (i = 0; i < chartData.size(); i++) {
value += chartData.get(i).getPartInPercent();
if (value > 100)
break;
}
if (i < chartData.size()) {
} else {
chartUtils = ChartHelper.generateArcWithPercent(chartData);
}
} else {
chartUtils = ChartHelper.generateArc(chartData);
}
alpha = 255 / chartData.size();
textPaintAbout.setTextSize(textSize);
}
}
...............
}
data1.add(new ChartData("40%", 40, Color.WHITE, Color.parseColor("#33691E")));
data1.add(new ChartData("40%", 40, Color.WHITE, Color.parseColor("#f42e48")));
data1.add(new ChartData("18%", 18, Color.WHITE, Color.parseColor("#FFD600")));
data1.add(new ChartData("2%", 2, Color.WHITE, Color.parseColor("#C3C3C3")));
data1.add(new ChartData("40%", 40, Color.WHITE, Color.parseColor("#33691E")));
data1.add(new ChartData("40%", 40, Color.WHITE, Color.parseColor("#f42e48")));
data1.add(new ChartData("20%", 20, Color.WHITE, Color.parseColor("#FFD600")));
data1.add(new ChartData("0%", 0, Color.WHITE, Color.parseColor("#C3C3C3")));
data.add(new ChartData("", (float) redPer, Color.WHITE, Color.parseColor("#fe1f20")));
here Color.parseColor("#fe1f20") i want to remove color. means i have no need to identify color it automatically pick color from main layout color.
if any solution please help me
Thank you
Hello, starting point of the charth is 90 degrees, how can we start it at 0 degrees (I mean begin it at clock 12 side).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.