Java Reference
In-Depth Information
The PieChart class is actually simpler to use than the rest of the charts listed. PieChart
uses a sequence of PieChart.Data to represent the data that will be plotted, where you
provide PieChart.Data.label and PieChart.Data.value properties. Both PieChart
and PieChart3D share the same properties and can be easily switched for one another.
Chart customization
The Chart API makes it easy to customize the look and behavior of your charts. Depending on
the type of the chart you are creating, you have access to an assortment of properties that
you can customize, including the data element's paint, effect, stroke, and node. You also have
the ability to specify interaction behavior by providing an action:function() property for
each data element on the chart using the Data class.
The BarChart class allows you to provide an instance of the Node class for each data item
in the data series. To illustrate how to use this feature, we modify the code from the recipe
(leaving only three data members) and define a function for the property BarChart.Data.
barCreator as shown in the next code snippet. You can get the entire code listing from
ch06/source-code/src/chart/BarChartCustomDemo.fx .
def width = 640;
def barWidth = (width/6) - 30;
var dataSeries = [
BarChart.Series {
name: "Nokia"
data: [
BarChart.Data {category: cats[0] value: 16.1},
BarChart.Data {category: cats[1] value: 15.4}
]
 
Search WWH ::




Custom Search