Welcome Guest Search | Active Topics |

Scatter Chart with Date on X
GregFoss
#1 Posted : Monday, August 6, 2012 2:58:22 PM(UTC)
Rank: Member

Groups: jQueryChart, Registered
Joined: 6/7/2012(UTC)
Posts: 16

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Hello All,
I'm making a simple scatter chart with a date x-axis. I'm not sure of the format, I've gotten pretty close with the following but the markers themselves do not show up. The y-axis adjusts accordingly so I know it is seen. Does anyone see something glaringly wrong here?

Code:
<script lang="javascript" type="text/javascript">
        $(document).ready(function () {
            $('#jqChart').jqChart({
                title: { text: 'Scatter Chart' },
                series: [
                            {
                                title: 'Scatter 1',
                                type: 'scatter',
                                data: [['12/01/2010', 100], ['12/02/2010', 2], ['12/03/2010', 3],['12/04/2010', 100], ['12/05/2010', 2], ['12/06/2010', 3]],
                                markers: { type: 'diamond', size: 8 }
                            },
                            {
                                title: 'Scatter 2',
                                type: 'scatter',
                                data: [['12/01/2010', 10], ['12/02/2010', 5], ['12/03/2010', 4]],
                                markers: { type: 'rectangle', size: 8 }
                            }
                        ]
            });
        });
    </script>
Dragan
#2 Posted : Tuesday, August 7, 2012 4:21:50 AM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Hi,

You need to add Date values instead of strings:

Code:
data : [[new Date('12/01/2010'), 100], ...


Best Regards,
Dragan Matek
jqChart Inc.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.077 seconds.