Solved

Chart Scale

Posted on 2004-04-20
4
334 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Great!  That's the ticket.  Thanks...points being awarded now.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now