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.
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)
| Wow! Thanks Tod! --- On Tue, 1/12/10, tod Landis <t...@dbentrance.com> wrote: |
|