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
|
meta.inf.dir=${src.dir}/META-INF
|
||||||
mkdist.disabled=false
|
mkdist.disabled=false
|
||||||
native.bundling.enabled=false
|
native.bundling.enabled=false
|
||||||
platform.active=JDK_8__System_
|
platform.active=JDK_1.8
|
||||||
run.classpath=\
|
run.classpath=\
|
||||||
${dist.jar}:\
|
${dist.jar}:\
|
||||||
${javac.classpath}:\
|
${javac.classpath}:\
|
||||||
|
@ -24,18 +24,19 @@ public class PieChart extends Application {
|
|||||||
// Create pane
|
// Create pane
|
||||||
Pane pane = new Pane();
|
Pane pane = new Pane();
|
||||||
ArrayList<Arc> pie = new ArrayList<Arc>();
|
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;
|
int j = 1;
|
||||||
float angle = 0.0f;
|
float startAngle = 0.0f;
|
||||||
|
final float PIE_SIZE = 200.0f;
|
||||||
for (int i = 0; i < 4; i++) {
|
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]));
|
System.out.println("i:" + toDegrees(pieValues[i]) + " j: " + toDegrees(pieValues[j]));
|
||||||
Arc pieSlice = new Arc();
|
Arc pieSlice = new Arc();
|
||||||
pieSlice.setCenterX(100.0f);
|
pieSlice.setCenterX(PIE_SIZE);
|
||||||
pieSlice.setCenterY(100.0f);
|
pieSlice.setCenterY(PIE_SIZE);
|
||||||
pieSlice.setRadiusX(100.0f);
|
pieSlice.setRadiusX(PIE_SIZE);
|
||||||
pieSlice.setRadiusY(100.0f);
|
pieSlice.setRadiusY(PIE_SIZE);
|
||||||
pieSlice.setStartAngle(toDegrees(pieValues[i])); //toDegrees(pieValues[i])
|
pieSlice.setStartAngle(startAngle); //toDegrees(pieValues[i])
|
||||||
pieSlice.setLength(toDegrees(pieValues[j++]));
|
pieSlice.setLength(toDegrees(pieValues[j++]));
|
||||||
pieSlice.setType(ArcType.ROUND);
|
pieSlice.setType(ArcType.ROUND);
|
||||||
pie.add(pieSlice);
|
pie.add(pieSlice);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user