Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
SpectraKing100 #1
format y-axis in cfchart
The values displayed on the y-axis are are mix of float and int. The chart
displays int values on the y-axis if I use only one cfchartseries tag. The code
below calculates the value for the gridlines and scaleto attributes.When I output this variable, the value returned is 88 and when ICode:<cfset scTo=evaluate(ArrayMax(ListToArray(valuelist(qJobsLogged.JOBSCOUNT)))+1)>
execute the below code I get the following on the y-axis: 6 ,18, 30, 42, 54,
66, 78However, when I add 3 more chartseries tag to the above code, I getCode:<cfchart show3d='yes' gridlines='#evaluate(scTo+1)#' yaxistype='scale' labelformat='number' scalefrom='0' scaleto='#scTo#' format='jpg' xAxisTitle='log date' yAxisTitle='jobs logged' chartheight='300' chartwidth='450' sortxaxis='no' showborder='yes' showxgridlines='yes' showygridlines='yes' seriesplacement='stacked' font='Arial' fontsize='12' fontbold='yes'> <cfchartseries type='bar' serieslabel='Critical' query='qJobsLogged' itemcolumn='DTLOGGED' valuecolumn='JOBSCOUNT'> <cfif qJobsLogged.jobPriority eq 1> <cfchartdata item='#qJobsLogged.DTLOGGED#' value='#qJobsLogged.JOBCOUNT#'> </cfif> </cfchartseries> </cfchart>
27.7, 83, 138.4, 193.8, 249.1, 304.5Can any mathematician helpCode:<cfset scTo=evaluate(ArrayMax(ListToArray(valuelist(qJobsLogged.JOBCOUNT)))+1)> <cfchart show3d='yes' gridlines='#evaluate(scTo+1)#' yaxistype='scale' labelformat='number' scalefrom='0' scaleto='#scTo#' format='jpg' xAxisTitle='log date' yAxisTitle='jobs logged' chartheight='300' chartwidth='450' sortxaxis='no' showborder='yes' showxgridlines='yes' showygridlines='yes' seriesplacement='stacked' font='Arial' fontsize='12' fontbold='yes'> <cfchartseries type='bar' serieslabel='Critical' query='qJobsLogged' itemcolumn='DTLOGGED' valuecolumn='JOBSCOUNT'> <cfif qJobsLogged.jobPriority eq 1> <cfchartdata item='#qJobsLogged.DTLOGGED#' value='#qJobsLogged.JOBCOUNT#'> </cfif> </cfchartseries> <cfchartseries type='bar' serieslabel='Urgent' query='qJobsLogged' itemcolumn='DTLOGGED' valuecolumn='JOBCOUNT'> <cfif qJobsLogged.jobPriority eq 2> <cfchartdata item='#qJobsLogged.DTLOGGED#' value='#qJobsLogged.JOBCOUNT#'> </cfif> </cfchartseries> <cfchartseries type='bar' serieslabel='Normal' query='qJobsLogged' itemcolumn='DTLOGGED' valuecolumn='JOBCOUNT'> <cfif qJobsLogged.jobPriority eq 3> <cfchartdata item='#qJobsLogged.DTLOGGED#' value='#qJobsLogged.JOBCOUNT#'> </cfif> </cfchartseries> <cfchartseries type='bar' serieslabel='Other' query='qJobsLogged' itemcolumn='DTLOGGED' valuecolumn='JOBCOUNT'> <cfif qJobsLogged.jobPriority gt 3> <cfchartdata item='#qJobsLogged.DTLOGGED#' value='#qJobsLogged.JOBCOUNT#'> </cfif> </cfchartseries> </cfchart>
please Regards cfcoder
SpectraKing100 Guest
-
CFChart in Flash Format
Can a CFChart with a Flash format have transparency? For instance, when you create a flash formatted cfform there is a wmode attribute that can be... -
cfchart rotate x axis labels
This should be very easy to do. I want my x axis labels to be horizontial not vertical. How do I do this? Thanks trainmom -
cfchart and the x axis
I'm working on a weight loss application and am trying out the CFCHART tag for the first time. I'm charting weight over time. In working with the... -
cfchart axis does not round
I've noticed that when using CFCHART and when I'm showing a bar data that on the axis is always uses decimal points when showing the range of my... -
cfchart problem: i have too many entries in on axis
You can use the Webcharts utility , which is located in the charting directory. You can define your own style and then refrence it using the format... -
SpectraKing100 #2
Re: format y-axis in cfchart
Hi again, I'm just so loosing my focus here. Not knowing how this things works
is probably what's getting me all frustrated. Ok, here is what my query looks
like <cfquery name='qBar' datasource='testDB'> SELECT CONVERT(varchar(15),
dt.dtlogged, 106) AS dtlogged, dt.jobcount, j.jobPriority, j.jobNumber FROM (
SELECT CAST(CONVERT(varchar(15), logdatetime, 106) AS datetime) AS dtlogged,
COUNT(*) AS jobcount FROM job WHERE logdatetime >= '01/02/2005
00:00:00' AND logdatetime <= '02/02/2005 23:59:59' GROUP BY
CAST(CONVERT(varchar(15), logdatetime, 106) AS datetime) ) dt JOIN job j ON
dt.dtlogged = CAST(CONVERT(varchar(15), j.logdatetime, 106) AS datetime)
ORDER BY dtLogged </cfquery> And when I dump it, it looks something like this:
query CALLCOUNT JOBNUMBER JOBPRIORITY DTLOGGED 1 2
01BS093789 2 01 Feb 2005 2 2 01BS093795 3
01 Feb 2005 3 3 01BS093872 6 02 Feb 2005 4 3
01BS093883 6 02 Feb 2005 5 3 01BS093888 1
02 Feb 2005 I hope it is making sense so far. I now what to build a
chart with the date on the x-axis and the no of jobs logged in a day on the
y-axis. In the example above, there are 2 jobs logged on the 1st of Feb each
with a different jobPriority. I want the the user to be able to see this in the
chart which is why I've added the <cfif> block inside the chartseries tag, but
becuase the cfif is inside the chartseries tag and not outside, the chart
representation of the data is not right. I don't know the right way to do this.
Can you please help Regards cfcoder
SpectraKing100 Guest



Reply With Quote

