pie3dWant to know how easy it is to create a 3D pie chart with the new JavaFX 1.2 chart API? All the code you need to create this is:

import javafx.stage.Stage;
import javafx.stage.Alert;
import javafx.scene.Scene;
import javafx.scene.chart.PieChart;
import javafx.scene.chart.PieChart3D;

Stage {
    scene: Scene {
        height: 400
        width: 500
        content: PieChart3D {
            title: "Sample Pie"
            startAngle: 0
            data: [
                PieChart.Data { label: "Apples" value: 34 },
                PieChart.Data { label: "Oranges" value: 27 },
                PieChart.Data { label: "Bananas" value: 16 },
                PieChart.Data { label: "Grapes" value: 50 },
                PieChart.Data { label: "Cherries" value: 6 },
                PieChart.Data { label: "Strawberries" value: 5 },
                PieChart.Data { label: "Raspberries" value: 7 }
            ]
        }
    }
}

The JavaFX charts API is based on the idea of a “Visual Model” so each PieChart.Data represents a single slice of the pie so if you would like to add an action to one of the pie slices this can be done like this:

PieChart.Data { 
    label: "Apples" 
    value: 34 action:function(){Alert.inform("Clicked on Apples")} 
}

Here is a web start link to try it out for your self Lanuch Webstart