Solved

Chart Scale

Posted on 2004-04-20
4
336 Views
Last Modified: 2013-12-24
Good morning,
  I am having a problem with chart scale...

We have a range of customers that are all the way from large ($300,000) per month to very small ($100) per month.

Executives look up sales and I have a form that is WORKING very well...the data is returned and the chart is attractive.  But the small customer charts look like there are "bumps" instead of and real data.

I'm sure I have to do something with the "scale to" section but can't figure it out.

My code is below.  I'm sure you can guess the results if a customer has $25 max in any one month. I need this resolved quickly...I'd like to go live for all executives without "explanations."  A perfect solution would be for them to have the option of scaling or not.

<cfchart>
xAxisTitle="Sales By Month - Last 4 Years"
yAxisTitle="Sales"
chartwidth="650"
showygridlines="yes"
scaleFrom="0"
scaleTo="300000"
gridlines="5"
show3d="yes">

<cfchartseries type="bar"
seriesLabel="Current Year" seriescolor="33FF33">
<cfchartData item="Jan" value="#chart_2004.Jan#">      
<cfchartData item="Feb" value="#chart_2004.Feb#">      
<cfchartData item="Mar" value="#chart_2004.Mar#">      
<cfchartData item="Apr" value="#chart_2004.Apr#">      
<cfchartData item="May" value="#chart_2004.May#">      
<cfchartData item="Jun" value="#chart_2004.Jun#">      
<cfchartData item="Jul" value="#chart_2004.Jul#">      
<cfchartData item="Aug" value="#chart_2004.Aug#">      
<cfchartData item="Sept" value="#chart_2004.Sept#">
<cfchartData item="Oct" value="#chart_2004.Oct#">            
<cfchartData item="Nov" value="#chart_2004.Nov#">      
<cfchartData item="Dec" value="#chart_2004.Dec#">      
</cfchartseries>
                                          
<cfchartseries type="bar"
seriesLabel="2003" seriescolor="FF9933">
<cfchartData item="Jan" value="#chart_2003.Jan#">      
<cfchartData item="Feb" value="#chart_2003.Feb#">      
<cfchartData item="Mar" value="#chart_2003.Mar#">      
<cfchartData item="Apr" value="#chart_2003.Apr#">      
<cfchartData item="May" value="#chart_2003.May#">      
<cfchartData item="Jun" value="#chart_2003.Jun#">      
<cfchartData item="Jul" value="#chart_2003.Jul#">      
<cfchartData item="Aug" value="#chart_2003.Aug#">      
<cfchartData item="Sept" value="#chart_2003.Sept#">
<cfchartData item="Oct" value="#chart_2003.Oct#">            
<cfchartData item="Nov" value="#chart_2003.Nov#">      
<cfchartData item="Dec" value="#chart_2003.Dec#">
</cfchartseries>                                          
</cfchart>
0
Comment
Question by:lrbrister
  • 2
  • 2
4 Comments
 
LVL 35

Expert Comment

by:mrichmon
ID: 10873370
what about pulling the max amount and sending that as a variable to the scaleTo attribute?

So if you knew that the max amount for a customer was $25 then you would send $25 to the scaleTo field instead of hardcoding in the 300000
0
 

Author Comment

by:lrbrister
ID: 10873408
To mrichmon

Could you give me an example of that in the code above
0
 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 10873435
Well I assume that you have a query that pulls the maximum amount correct?  It is hard to say with only the code you have shown....    Or at least you could write one?

Something like this :

<cfquery datasource="mydsn" name="GetMax">
SELECT MAX(amount) as maxvalue from mytable
</cfquery>

Then you could use the value in the scaleTo

<cfchart>
xAxisTitle="Sales By Month - Last 4 Years"
yAxisTitle="Sales"
chartwidth="650"
showygridlines="yes"
scaleFrom="0"
scaleTo="#GetMax.maxvalue#"
gridlines="5"
show3d="yes">
0
 

Author Comment

by:lrbrister
ID: 10873450
Great!  That's the ticket.  Thanks...points being awarded now.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
website file permissions 4 78
Asp.net Hosting Plan security, reliable, stable 1 79
assigning port numbers to web sites and web services 2 79
PHP in Apache server 20 102
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question