Documentation on OTHERSLICE for the PieChart?

7 views
Skip to first unread message

CWW

unread,
Jan 12, 2010, 12:02:10 PM1/12/10
to Entrance
Hi all,

When aggregating remaining slices into an "otherslice" how is the
number calculated? And can I add a legend to a pie chart?

Thanks for any help you can provide.

tod Landis

unread,
Jan 12, 2010, 8:44:45 PM1/12/10
to Entrance

OTHERSLICE is an undocumented feature of PIECHART: Here is the
syntax:
OTHERSLICE "(label)" (amount) (color)

For example:
OTHERSLICE "misc" 20 BLUE
OTHERSLICE "other items" 300.00 VERY LIGHT RED. .

You can play with this in the test versions currently in the the test
area, if you have the links. (Please email if you need them)
It will also work with the release you have installed now, excpet
that colors will be ignored.

OTHERSLICE adds an additional pie slice and increases the pie total by
the 'amount' you specify. The cool thing is that you can query for
slice values satisfying a given WHERE clause and throw everything else
into an other slice. Example attached.

On the subject of undocumented features to be surfaced in the next
version: you can also try EXPLODE. EXPLODE is a series type, like
PIEVALUE or PIELABEL, It specifies a percentatge amount, 0-100, to
push a slice out from the center. Generally 10 is a good value to
start with.

Legends haven't been supported for PieCharts, but they will be in the
next version (which is also in the test area now). You can use LEGEND
BOTTOM, LEGEND RIGHT or LEGEND AT (x) (y) where x and y are values
0-1000

LEGEND AT 700 100 is a good place to start for a legend on a pie
chart..Specify items for pie chart LEGEND using LEGENDITEM, eg:
LIGHT BLUE LEGENDITEM "first"
LIGHT RED LEGENDITEM "second"

Sorry for the quick notes. I'll try to have something a little
better on the blog for you soon....
- Tod

========================================================================

-- drop table if exists pietemp;

create table pietemp (
name varchar(255),
val int,
color varchar(255)
);

insert into pietemp values
('one', 30, 'very light red'),
('two', 10, 'light red'),
('three', 5, 'red'),
('four', 30, 'very light red'),
('five', 10, 'light red'),
('size', 5, 'red'),
('seven', 30, 'very light red'),
('eight', 10, 'light red'),
('nine', 5, 'red')
;

set @other = (select sum(val) from pietemp
where not name like 'F%');

plot pie
pielabel, pievalue, color override, explode
with
otherslice "other" @other light blue
title "Names Beginning With 'F'"
select name, val, color
from pietemp
where name like 'f%'
;

You can try out this script in your current version, but
the other color value will be ignored. (If you would like access to
test versions, email me and I will send links)

Cheryl Handsaker

unread,
Jan 12, 2010, 10:02:44 PM1/12/10
to dbent...@googlegroups.com
Wow! Thanks Tod!

--- On Tue, 1/12/10, tod Landis <t...@dbentrance.com> wrote:
--
You received this message because you are subscribed to the Google Groups "Entrance" group.
To post to this group, send email to dbent...@googlegroups.com.
To unsubscribe from this group, send email to dbentrance+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dbentrance?hl=en.



Reply all
Reply to author
Forward
0 new messages