Welcome Guest Search | Active Topics |

Short time not binding to the Gantt chart
Venkat0110
#1 Posted : Monday, September 23, 2013 3:16:49 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/23/2013(UTC)
Posts: 3

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

When i convert the date to short time, it is not binding to the chart. Please find the code snippet below,

public SampleViewModel GetPrograms()
{
var returnData = new SampleViewModel();
var chartDataList = new List<TitleDetails>();

for (var count = 5; count >=1; count--)
{
var titles = new TitleDetails
{
Title = "Title " + count,
FromValues = new DateTime(2010, 1, 1).AddDays(count).ToShortTimeString(),
ToValues = new DateTime(2010, 1, 30).AddDays(count).AddMonths(-3).ToShortTimeString()
};
chartDataList.Add(titles);



}
returnData.ChartData = chartDataList;

return returnData;
}

Thanks,
Venkatesh
Dragan
#2 Posted : Tuesday, September 24, 2013 7:56:03 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)
The values needs to be DateTime, so don't convert them to string.

If you want to format the chart axis labels you can check:

http://www.jqchart.com/documentationAspNetMVC/userguide/Default.aspx#!LabelsFormatting
Best Regards,
Dragan Matek
jqChart Inc.
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.071 seconds.