Welcome Guest Search | Active Topics |

Gantt chart with remote data
evangels
#1 Posted : Monday, January 6, 2014 1:08:25 AM(UTC)
Rank: Member

Groups: ExpiredLicense, Registered
Joined: 7/30/2013(UTC)
Posts: 15

Thanks: 6 times
Was thanked: 0 time(s) in 0 post(s)
I've seen the project schedule chart in the sample page which use the gantt chart type. That meet my requirement, but the sample use the inline data, can anyone please show me how to set project schedule chart with remote data, cause I see the data format is quite different with the gantt chart? Thanks a lot.
Dragan
#2 Posted : Tuesday, January 7, 2014 10:38:21 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)
We'll try preparing you such sample tomorrow.
Best Regards,
Dragan Matek
jqChart Inc.
Dragan
#3 Posted : Thursday, January 9, 2014 6:39:31 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)
You can try looking at this code:

Code:
        $(document).ready(function () {

            $.ajax({
                url: "remoteService",
                dataType: "json",
                success: function (data) {
                    initChart(data);
                }
            });
        });

        function initChart(data) {

            // the result data should be like:
            //
            //data = {
            //    user1 : [
            //        ['Design', new Date(2010, 0, 1), new Date(2010, 0, 20)],
            //        ['Development', new Date(2010, 0, 21), new Date(2010, 1, 15)],
            //        ['Design', new Date(2010, 1, 16), new Date(2010, 1, 28)],
            //        ['Development', new Date(2010, 2, 1), new Date(2010, 2, 20)],
            //        ['Testing', new Date(2010, 2, 21), new Date(2010, 3, 10)]
            //    ],
            //    user2 : [
            //        ['Design', new Date(2010, 0, 21), new Date(2010, 1, 15)],
            //        ['Development', new Date(2010, 1, 16), new Date(2010, 1, 28)],
            //        ['Testing', new Date(2010, 2, 1), new Date(2010, 2, 20)]
            //    ],
            //    user3: [
            //        ['Design'],
            //        ['Development', new Date(2010, 2, 21), new Date(2010, 3, 10)],
            //        ['Testing', new Date(2010, 1, 16), new Date(2010, 1, 28)],
            //        ['Testing', new Date(2010, 3, 11), new Date(2010, 4, 1)]
            //    ]
            //};

            $('#jqChart').jqChart({
                title: { text: 'Project Schedule' },
                animation: { duration: 1 },
                shadows: {
                    enabled: true
                },
                series: [
                    {
                        type: 'gantt',
                        title: 'Alan',
                        data: data.user1
                    },
                    {
                        type: 'gantt',
                        title: 'Carrie',
                        data: data.user2
                    },
                    {
                        type: 'gantt',
                        title: 'Katie',
                        data: data.user3
                    }
                ]
            });
        };
Best Regards,
Dragan Matek
jqChart Inc.
1 user thanked Dragan for this useful post.
evangels on 1/10/2014(UTC)
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.060 seconds.