SELECT AssessCount, ASSESSMENT, '##006600' AS sSliceColor FROM getCountGreenforOneATO_SMPCYCYMMRet UNION ALL SELECT AssessCount, ASSESSMENT, '##CC0000' AS sSliceColor FROM getCountRedforOneATO_SMPCYCYMMRet UNION ALL SELECT AssessCount, ASSESSMENT, '##FFFF00' AS sSliceColor FROM getCountYellowforOneATO_SMPCYCYMMRet Order BY ASSESSMENT, AssessCount [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => MikerRoo [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Series in Pie Chart - Coldfusion - Advanced Techniques

Series in Pie Chart - Coldfusion - Advanced Techniques

I have items in a database whose progress can be assessed at green, red or yellow depending on a set of criteria. I want to create a pie chart where the green ones are green, the red are red and the yellow are yellow. I want the colors to always be correct for that assessment regardless of whether or not all three types exist (if there are no greens, the reds should still be red and the yellows should still be yellow). So I create a query that is passed a G, R or Y and it return the appropriate ...

Sponsored Links
  1. #1

    Default Series in Pie Chart

    I have items in a database whose progress can be assessed at green, red or
    yellow depending on a set of criteria. I want to create a pie chart where the
    green ones are green, the red are red and the yellow are yellow. I want the
    colors to always be correct for that assessment regardless of whether or not
    all three types exist (if there are no greens, the reds should still be red and
    the yellows should still be yellow). So I create a query that is passed a G, R
    or Y and it return the appropriate items. Then I created a chart with
    chartseries for each type. As follows:

    <cfchart format="flash" show3d="yes" pieslicestyle="solid" >
    <cfchartseries type="pie" query="getCountGreenforOneATO_SMPCYCYMMRet"
    itemcolumn="ASSESSMENT"
    valuecolumn="AssessCount" colorlist="##006600" />
    <cfchartseries type="pie" query="getCountRedforOneATO_SMPCYCYMMRet"
    itemcolumn="ASSESSMENT"
    valuecolumn="AssessCount" colorlist="##CC0000" />
    <cfchartseries type="pie" query="getCountYellowforOneATO_SMPCYCYMMRet"
    itemcolumn="ASSESSMENT"
    valuecolumn="AssessCount" colorlist="##FFFF00" />
    </cfchart>

    This seems to work fine for TYPE="BAR" and the assessments that exist are
    displayed. If I change to TYPE="PIE" it only shows the first one which in this
    case are the greens. If I delete the series for the greens it shows the reds,
    etc.

    What am I missing?

    Thanks

    Sponsored Links
    Alandi Guest

  2. #2

    Default Re: Series in Pie Chart

    Pie charts can only effectively have one series. There is nowhere to put a
    second series, graphically, except under the first one (where it can't be
    seen). ("Three D" is just window dressing on the topmost pie.)

    So, if you want to display this data on one pie, you need to merge the series
    into one.

    I've attached code that does that.

    Regards,
    -- MikeR



    <!--- Merge the data into one series so it can be pie charted.
    Note that if there is more than one item per color, it will be
    indistinguishable from neighboring slices of the same color
    (except by any data label).
    --->
    <CFQUERY name="qPieSeries" dbtype="query">
    SELECT
    AssessCount,
    ASSESSMENT,
    '##006600' AS sSliceColor
    FROM
    getCountGreenforOneATO_SMPCYCYMMRet

    UNION ALL SELECT
    AssessCount,
    ASSESSMENT,
    '##CC0000' AS sSliceColor
    FROM
    getCountRedforOneATO_SMPCYCYMMRet

    UNION ALL SELECT
    AssessCount,
    ASSESSMENT,
    '##FFFF00' AS sSliceColor
    FROM
    getCountYellowforOneATO_SMPCYCYMMRet

    Order BY
    ASSESSMENT, <!--- This Ordered, presumably, by importance. Like
    colors may not be adjacent. --->
    AssessCount
    </CFQUERY>

    <CFSET sPieColorList = ValueList (qPieSeries.sSliceColor)>

    <cfchart format="flash" show3d="yes" pieslicestyle="solid">
    <cfchartseries
    type = "pie"
    query = "qPieSeries"
    itemcolumn = "ASSESSMENT"
    valuecolumn = "AssessCount"
    colorlist = #sPieColorList#
    />
    </cfchart>

    MikerRoo Guest

  3. #3

    Default Re: Series in Pie Chart

    Thanks MikerRoo, That is perfect.
    Alandi Guest

Similar Threads

  1. Multiple series chart with differing dates
    By Solerous in forum Macromedia Flex General Discussion
    Replies: 2
    Last Post: April 21st, 02:58 PM
  2. How do I dynamically add a series to a chart? flex 1.5
    By biggermork in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: January 23rd, 06:46 PM
  3. Multiple Chart Series using different dataProvider
    By jmicah in forum Macromedia Flex General Discussion
    Replies: 8
    Last Post: September 8th, 09:50 PM
  4. Dynamic Series in Bar Chart
    By tommywolf in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: May 24th, 03:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •