Welcome Guest Search | Active Topics |

Gantt chart current date line
fronda@libero.it
#1 Posted : Monday, November 25, 2013 5:21:30 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/7/2013(UTC)
Posts: 6

Thanks: 2 times
Was thanked: 0 time(s) in 0 post(s)
Hi,
I would like to have a vertical red line (more or less like a crosshair vertical line) showing current date in order to see where the project is...
How can I do this ?

Thanks a lot.

Fabio Fronda

Ps. Jqchart is cool!!!
Dragan
#2 Posted : Monday, November 25, 2013 7:07:12 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 can use axis plot line:
http://www.jqchart.com/jquery/chart/ChartAxes/PlotLines

In your case the code should look like:

Code:
$(document).ready(function () {
            $('#jqChart').jqChart({
                title: { text: 'DateTime Axis' },
                animation: { duration: 1 },
                axes: [
                    {
                        type: 'dateTime',
                        location: 'bottom',
                        plotLines: [
                            {
                                value: new Date(2011, 1, 16),
                                strokeStyle: 'red',
                                lineWidth: 2
                            }
                        ]
                    }
                ],
                series: [
                    {
                        type: 'line',
                        data: [[new Date(2011, 1, 6), 70], [new Date(2011, 1, 8), 82],
                               [new Date(2011, 1, 10), 85], [new Date(2011, 1, 12), 70],
                               [new Date(2011, 1, 14), 65], [new Date(2011, 1, 16), 68]]
                    }
                ]
            });
        });
Best Regards,
Dragan Matek
jqChart Inc.
fronda@libero.it
#3 Posted : Monday, November 25, 2013 9:05:53 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/7/2013(UTC)
Posts: 6

Thanks: 2 times
Was thanked: 0 time(s) in 0 post(s)
dragan wrote:
Hi,

You can use axis plot line:
http://www.jqchart.com/jquery/chart/ChartAxes/PlotLines

In your case the code should look like:

Code:
$(document).ready(function () {
            $('#jqChart').jqChart({
                title: { text: 'DateTime Axis' },
                animation: { duration: 1 },
                axes: [
                    {
                        type: 'dateTime',
                        location: 'bottom',
                        plotLines: [
                            {
                                value: new Date(2011, 1, 16),
                                strokeStyle: 'red',
                                lineWidth: 2
                            }
                        ]
                    }
                ],
                series: [
                    {
                        type: 'line',
                        data: [[new Date(2011, 1, 6), 70], [new Date(2011, 1, 8), 82],
                               [new Date(2011, 1, 10), 85], [new Date(2011, 1, 12), 70],
                               [new Date(2011, 1, 14), 65], [new Date(2011, 1, 16), 68]]
                    }
                ]
            });
        });


Works perfectly!
Thanks a lot!
Users browsing this topic
Guest
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.056 seconds.