I'm having a problem with cfchart bugging out.

I think it's a problem with the x-axis scaling, although I can't get it to work no matter what I do.

This first came to light when trying to chart numbers over date ranges. Aware of the problems for which dates are notorious, I converted them into yyyymmdd numbers, strings, and even tried incrementing integers, but no matter what I try the result is the same.

Furthermore, I've tried getting my data from queries, arrays, and manually (see example).

The problem is this: if I try and render a line-chart with more than one data series and the item categories aren't absolutely identical the lines break. The values are plotted correctly (as dots), but the lines vanish.

Here's a quick example I just knocked up (arbitrary data/bare minimum code) :

<cfchart>
    <cfchartseries type="line">
        <cfchartdata item="20070516" value="10">
        <cfchartdata item="20070517" value="20">
        <cfchartdata item="20070518" value="30">
        <cfchartdata item="20070519" value="40">
        <cfchartdata item="20070525" value="60">
        <cfchartdata item="20070530" value="80">
        <cfchartdata item="20070604" value="90">
        <cfchartdata item="20070609" value="75">
        <cfchartdata item="20070615" value="30">
        <cfchartdata item="20070620" value="20">
        <cfchartdata item="20070624" value="5">
    </cfchartseries>
    <cfchartseries type="line">
        <cfchartdata item="20070518" value="10">
        <cfchartdata item="20070520" value="20">
        <cfchartdata item="20070526" value="30">
        <cfchartdata item="20070527" value="40">
        <cfchartdata item="20070603" value="60">
        <cfchartdata item="20070604" value="80">
        <cfchartdata item="20070608" value="90">
        <cfchartdata item="20070612" value="75">
        <cfchartdata item="20070618" value="30">
        <cfchartdata item="20070625" value="20">
        <cfchartdata item="20070627" value="5">
    </cfchartseries>
</cfchart>

With "sortaxis='yes'" it renders the following:

http://i22.photobucket.com/albums/b331/rynooo/b9699e6b.png

and with it set to 'no' I get this:

http://i22.photobucket.com/albums/b331/rynooo/2194511f.png

(still broken).

Can anyone suggest how I can get around this? It's impractical to use a common x-axis as not ever date (for example) has an associated value. I've tried using null values but that errors out.

I have the exact same problem. where you able to find a workaround for this?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.