it work :D
This commit is contained in:
parent
82ccc27d9f
commit
aaf303eef0
@ -116,7 +116,7 @@ manifest.file=manifest.mf
|
||||
meta.inf.dir=${src.dir}/META-INF
|
||||
mkdist.disabled=false
|
||||
native.bundling.enabled=false
|
||||
platform.active=JDK_8__System_
|
||||
platform.active=JDK_1.8
|
||||
run.classpath=\
|
||||
${dist.jar}:\
|
||||
${javac.classpath}:\
|
||||
|
@ -24,18 +24,19 @@ public class PieChart extends Application {
|
||||
// Create pane
|
||||
Pane pane = new Pane();
|
||||
ArrayList<Arc> pie = new ArrayList<Arc>();
|
||||
float[] pieValues = {0.0f, 10.0f, 20.0f, 40.0f, 30.0f};
|
||||
float[] pieValues = {20.0f, 10.0f, 20.0f, 40.0f, 30.0f}; // First value controls the initial angle
|
||||
int j = 1;
|
||||
float angle = 0.0f;
|
||||
float startAngle = 0.0f;
|
||||
final float PIE_SIZE = 200.0f;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
angle = angle + toDegrees(pieValues[j]);
|
||||
startAngle = startAngle + toDegrees(pieValues[i]);
|
||||
System.out.println("i:" + toDegrees(pieValues[i]) + " j: " + toDegrees(pieValues[j]));
|
||||
Arc pieSlice = new Arc();
|
||||
pieSlice.setCenterX(100.0f);
|
||||
pieSlice.setCenterY(100.0f);
|
||||
pieSlice.setRadiusX(100.0f);
|
||||
pieSlice.setRadiusY(100.0f);
|
||||
pieSlice.setStartAngle(toDegrees(pieValues[i])); //toDegrees(pieValues[i])
|
||||
pieSlice.setCenterX(PIE_SIZE);
|
||||
pieSlice.setCenterY(PIE_SIZE);
|
||||
pieSlice.setRadiusX(PIE_SIZE);
|
||||
pieSlice.setRadiusY(PIE_SIZE);
|
||||
pieSlice.setStartAngle(startAngle); //toDegrees(pieValues[i])
|
||||
pieSlice.setLength(toDegrees(pieValues[j++]));
|
||||
pieSlice.setType(ArcType.ROUND);
|
||||
pie.add(pieSlice);
|
||||
|
Loading…
Reference in New Issue
Block a user