• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFCHART - Don't want lines to go to ends

New Here ,
Sep 16, 2009 Sep 16, 2009

Copy link to clipboard

Copied

OK, in CFChart, I want to have 2 sets of lines, one blue that start at the beginning, and then it turns green and goes to the end.  Here's my code:

<cfchart format="flash" chartheight="400" chartwidth="850" showxgridlines="yes" showygridlines="yes">
      <cfchartseries type="line" itemcolumn="WeekEnding" valuecolumn="TotalTested" serieslabel="Actual" seriescolor="##0000FF" >
       <cfchartdata value="1" item="2009-08-02">
       <cfchartdata value="7" item="2009-08-09">
       <cfchartdata value="10" item="2009-08-17">
      </cfchartseries>
      <cfchartseries type="line" itemcolumn="WeekEnding" valuecolumn="TotalTested" serieslabel="Projected" seriescolor="##009900" >
       <cfchartdata value="10" item="2009-08-17">
       <cfchartdata value="15" item="2009-08-23">
      </cfchartseries>
     </cfchart>

As you can see, I am trying to get one nice line that switches colors on August 17th. Unfortunately, for the blue line (Actual), it draws a straight line at level 10 to the 23rd. It also draws a green line from the 2nd to 17th at 10. And it sucks!

I tried combining them like this:

<cfchart format="flash" chartheight="400" chartwidth="850" showxgridlines="yes" showygridlines="yes">
      <cfchartseries type="line" itemcolumn="WeekEnding" valuecolumn="TotalTested" serieslabel="Actual" colorlist="##0000FF,##0000FF,##0000FF,##009900" >
       <cfchartdata value="1" item="2009-08-02">
       <cfchartdata value="7" item="2009-08-09">
       <cfchartdata value="10" item="2009-08-17">
       <cfchartdata value="15" item="2009-08-23">
      </cfchartseries>
     </cfchart>

But that draws the whole thing green. If anybody has a solution, help would be appreciated. Thanks!

TOPICS
Advanced techniques

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Sep 16, 2009 Sep 16, 2009

(Repost for the archives) Try modifying the isInterpolated setting in the XML style as mentioned here:

http://www.cftips.net/post.cfm/turning-off-interpolated-data-for-cfcharts

http://www.coldfusionjedi.com/index.cfm/2008/9/17/Ask-a-Jedi-Handling-nulls-in-a-chart

<frameChart autoAdjust="false" is3D="false" isInterpolated="false">

....

Votes

Translate

Translate
New Here ,
Sep 16, 2009 Sep 16, 2009

Copy link to clipboard

Copied

I found the answer on my own (but I hope it helps somebody else out)...

Just add this to your cfchart tag:

style="<frameChart></frameChart>"

I don't quite get it, but it works!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Sep 16, 2009 Sep 16, 2009

Copy link to clipboard

Copied

(Repost for the archives) Try modifying the isInterpolated setting in the XML style as mentioned here:

http://www.cftips.net/post.cfm/turning-off-interpolated-data-for-cfcharts

http://www.coldfusionjedi.com/index.cfm/2008/9/17/Ask-a-Jedi-Handling-nulls-in-a-chart

<frameChart autoAdjust="false" is3D="false" isInterpolated="false">

....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Sep 16, 2009 Sep 16, 2009

Copy link to clipboard

Copied

Kling wrote:

I don't quite get it, but it works!

It is due to the default xml settings for cfchart. Look at the link above (one by Raymond Camden). It explains why your change works, and the correct way to control the chart behavior.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 22, 2009 Sep 22, 2009

Copy link to clipboard

Copied

LATEST

Thank you so much for your answer. I have read alot of Raymond Camden's stuff, but I am stuck on something:

IsInterpolated="false" stops drawing lines to the end (good)

it also will not show points if they don't have at least 2 sequential points on the x-axis (bad!)

i.e. my x-axis is every Sunday for about 2 years.

If my datapoints are:

TheDate                           TheNum

2009-09-20 00:00:00.000   400
2009-09-27 00:00:00.000   450
2009-10-11 00:00:00.000   600
2009-10-18 00:00:00.000   650
2009-11-01 00:00:00.000   750

It will draw the line from Sept 20-27th & from Oct 11th-18th.

It will NOT connect 9/27 and 10/11 and will NOT even show November 1st (unfortunately)

Is there a happy medium here? I want to see all of my data (and it would be nice to see lines) and don't want it to draw to the ends.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation