tracker issue : CF-4204474

select a category, or use search below
(searches all categories and all time range)
Title:

scalefrom/scaleto problem with values betweeen 0 and 1

| View in Tracker

Status/Resolution/Reason: To Fix//BugVerified

Reporter/Name(from Bugbase): Philipp C. / ()

Created: 05/31/2019

Components: Charting/Graphing, Server

Versions: 2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018.0.03.314033 /

Priority/Frequency: Normal / Most users will encounter

Locale/System: English / Mac 10 All

Vote Count: 0

I have a chart consisting of 10 values ranging from 0.015 to 0.029. If I try to limit the scales using the "scalefrom" and "scaleto" attributes like this: 

scalefrom="0.01" scaleto="0.03" 

cfchart seems to always revert to a scale ranging from 0 to 1. (See attached Example1.png)

If I remove the attributes the chart automatically scales from 0.00 to 0.03 However, I would like to get the chart so scale tighter to the actual values. (Example2.png)

This applies to a cfchart format=png with chartseries type=Line.

There are actually two bugs:

1) cfchart does not scale to the correct limits set via "scalefrom" and "scaleto"

2) automatic sizing does not seem to work correctly with values between 0 and 1. While the top margin gets set correctly, the bottom margin seems to be always 0. (See Example 3.png - different values, same problem, scale starts too low at 0 )

 This all seems like a minor issue at first glance, however it makes cfchart pretty much unusable if you want to provide meaningful charts since values cannot be visualized if the scales are too far off (see Example3.png where all values are skewed to the top of the chart and y-axis values cannot be determined)

Attachments:

Comments:

added missing Example1.png and Example2.png files
Comment by Philipp C.
30860 | June 03, 2019 09:29:24 AM GMT
Some sample code for you to illustrate the problem. We have lots of charts with values between 0.01 and 0.001 and unfortunately this bug makes cfchart completely unusable since it's impossible to scale to these values. <!--- In this chart scalefrom and scaleto work correctly. This is what the chart should look like even with values from 0.7 to 0.9 or values from 0.007 to 0.09 etc. ---> <cfchart format="html" chartHeight="400" chartWidth="600" showlegend="false" scalefrom="7" scaleto="9" > <cfchartseries type="area"> <cfloop from="1" to="10" index="i"> <cfchartdata item="#2009+i#" value=#randrange(7,9)#> </cfloop> </cfchartseries> </cfchart> <!--- Same chart no scaling ---> <cfchart format="html" chartHeight="400" chartWidth="600" showlegend="false"> <cfchartseries type="area"> <cfloop from="1" to="10" index="i"> <cfchartdata item="#2009+i#" value=#randrange(7,9)#> </cfloop> </cfchartseries> </cfchart> <!--- In this chart scalefrom and scaleto do not work at all and even worsen the chart since the top scale expands upwards to value 1 ---> <cfchart format="html" chartHeight="400" chartWidth="600" showlegend="false" scalefrom="0.07" scaleto="0.09" > <cfchartseries type="area"> <cfloop from="1" to="10" index="i"> <cfchartdata item="#2009+i#" value=#randrange(7,9)/100#> </cfloop> </cfchartseries> </cfchart> <!--- Same chart no scaling ---> <cfchart format="html" chartHeight="400" chartWidth="600" showlegend="false"> <cfchartseries type="area"> <cfloop from="1" to="10" index="i"> <cfchartdata item="#2009+i#" value=#randrange(7,9)/100#> </cfloop> </cfchartseries> </cfchart>
Comment by Philipp C.
30890 | June 08, 2019 10:44:45 PM GMT
@Philipp Looks like ZingChart limitation, we will discuss with ZingChart and get back to you.
Comment by Dattanand M.
30960 | June 27, 2019 05:05:54 AM GMT