Solved

Chart Scale

Posted on 2004-04-20
4
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…

732 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