Pie
Pie using Chart
Example 1
Summary: Creates a pie chart with Size Co as the X-axis and N as the Y-axis, adding a pie chart element and configuring the category axis to hide labels.
Code:
Open("data_table.jmp");
obj = Chart( X( :Size Co ), Y( N( N ) ), Pie( 1 ), Category Axis << {Label( None )} );
Code Explanation:
- Open data table;
- Create chart object.
- Set X variable to Size Co.
- Set Y variable to N.
- Add pie chart element.
- Configure category axis.
- Hide category labels.
Example 2
Summary: Creates a pie chart from a data table, specifying the size column as the X-axis variable and the N() function as the Y-axis variable.
Code:
dt = Open("data_table.jmp");
obj = Chart( X( :Size Co ), Y( N( N ) ), Pie( 1 ), Category Axis << {Label( None )} );
Code Explanation:
- Open data table;
- Create chart object.
- Set X-axis variable.
- Set Y-axis variable.
- Add pie chart type.
- Hide category axis labels.
Example 3
Summary: Creates a pie chart to visualize data distribution by age, utilizing JMP's Chart function with customized color levels and labels.
Code:
Open("data_table.jmp");
obj = Chart(
X( :age ),
Y( N( N ) ),
Pie( 1 ),
Category Axis << {Label( None )},
Label by Percent of Total Values,
Show Labels,
Level[1] << Colors( 3 ),
Level[2] << Colors( 5 ),
Level[3] << Colors( 9 ),
Level[4] << Colors( 7 ),
Level[5] << Colors( 8 ),
Level[6] << Colors( 4 ),
);
Code Explanation:
- Open data table;
- Create chart object.
- Set X axis to "age".
- Set Y axis to count.
- Add pie chart type.
- Hide category labels.
- Label by percent.
- Show data labels.
- Set level 1 colors.
- Set level 2 colors.
- Set level 3 colors.
- Set level 4 colors.
- Set level 5 colors.
- Set level 6 colors.
Example 4
Summary: Creates a pie chart to visualize the distribution of values in a data table, with customizable colors for each level.
Code:
dt = Open("data_table.jmp");
obj = Chart(
X( :age ),
Y( N( N ) ),
Pie( 1 ),
Category Axis << {Label( None )},
Label by Percent of Total Values,
Show Labels,
Level[1] << Colors( 3 ),
Level[2] << Colors( 5 ),
Level[3] << Colors( 9 ),
Level[4] << Colors( 7 ),
Level[5] << Colors( 8 ),
Level[6] << Colors( 4 ),
);
Code Explanation:
- Open data table.
- Create chart object.
- Set X axis to age.
- Set Y axis to count.
- Add pie chart type.
- Hide category labels.
- Label by percentage.
- Show value labels.
- Set level 1 colors.
- Set level 2 colors.
- Set level 3 colors.
- Set level 4 colors.
- Set level 5 colors.
- Set level 6 colors.
Example 5
Summary: Creates a pie chart to visualize data distribution, with customizable colors for levels 1-3 and labels showing percentage values.
Code:
Open("data_table.jmp");
obj = Chart(
X( :Size Co ),
Y( N( N ) ),
Pie( 1 ),
Label by Percent of Total Values,
Show Labels,
Category Axis << {Label( None )},
Level[1] << Colors( 4 ),
Level[2] << Colors( 5 ),
Level[3] << Colors( 8 )
);
Code Explanation:
- Open data table;
- Create chart object.
- Set X axis variable.
- Set Y axis variable.
- Create pie chart.
- Label by percentage.
- Show labels on chart.
- Hide category axis labels.
- Set level 1 colors.
- Set level 2 colors.
- Set level 3 colors.
Example 6
Summary: Creates a pie chart with customized colors and labels from a data table, showcasing the 'Size Co' column on the X-axis and the 'N(N)' column on the Y-axis.
Code:
dt = Open("data_table.jmp");
obj = Chart(
X( :Size Co ),
Y( N( N ) ),
Pie( 1 ),
Label by Percent of Total Values,
Show Labels,
Category Axis << {Label( None )},
Level[1] << Colors( 4 ),
Level[2] << Colors( 5 ),
Level[3] << Colors( 8 )
);
Code Explanation:
- Open data table;
- Create chart object.
- Set X axis to Size Co.
- Set Y axis to N(N).
- Add pie chart type.
- Label by percent of total values.
- Show labels on chart.
- Hide category axis labels.
- Set level 1 colors to 4.
- Set level 2 colors to 5.
- Set level 3 colors to 8.