Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
JulsMan committed Jul 31, 2015
1 parent a695bbd commit f4cc4e4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
32 changes: 18 additions & 14 deletions GoogleChartsNGraphsControls/CHAPTimeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ public class CHAPTimeline : BaseWebControl
ViewState["visibleChartRangeEnd"] = value;
}
}

public void SetVisibleChartRange(DateTime start, DateTime end)
{
this.visibleChartRangeStart = start;
this.visibleChartRangeEnd = end;
}

public CHAPTimelineOptions TimelineOptions { get; set; }

public void ChartData(CHAPTimelineEvent[] ListOfEvents)
{

Expand All @@ -63,6 +65,8 @@ public void ChartData(CHAPTimelineEvent[] ListOfEvents)
dt.Columns.Add("start", typeof(DateTime));
dt.Columns.Add("end", typeof(DateTime));
dt.Columns.Add("content");
dt.Columns.Add("editable", typeof(bool));
dt.Columns.Add("group");
}


Expand Down Expand Up @@ -109,21 +113,21 @@ protected override void RenderContents(HtmlTextWriter output)

public override string ToString()
{
List<Newtonsoft.Json.JsonConverter> myconverters = new List<Newtonsoft.Json.JsonConverter>();
myconverters.Add(new CustomConvertersColorToRGB());
myconverters.Add(new CustomConvertersAxis());
myconverters.Add(new CustomConvertersLegend());
myconverters.Add(new CustomConverterEnum());
myconverters.Add(new CustomConverterTrendLine());

Newtonsoft.Json.JsonSerializerSettings settings = new Newtonsoft.Json.JsonSerializerSettings()
{
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
Converters = myconverters
};
//List<Newtonsoft.Json.JsonConverter> myconverters = new List<Newtonsoft.Json.JsonConverter>();
//myconverters.Add(new CustomConvertersColorToRGB());
//myconverters.Add(new CustomConvertersAxis());
//myconverters.Add(new CustomConvertersLegend());
//myconverters.Add(new CustomConverterEnum());
//myconverters.Add(new CustomConverterTrendLine());

//Newtonsoft.Json.JsonSerializerSettings settings = new Newtonsoft.Json.JsonSerializerSettings()
//{
// NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
// Converters = myconverters
//};

string s = string.Empty;
s = Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.None, settings);
s = Newtonsoft.Json.JsonConvert.SerializeObject(this.TimelineOptions, Newtonsoft.Json.Formatting.None);
return s;
}
}
Expand Down
3 changes: 2 additions & 1 deletion GoogleChartsNGraphsControls/DataStructs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public CHAPTimelineEvent()
this.start = DateTime.MinValue;
this.end = DateTime.MinValue;
this.content = string.Empty;
this.Editable = false;
this.editable = false;
this.group = string.Empty;
}
public CHAPTimelineEvent(DateTime start, string content): this()
{
Expand Down
1 change: 0 additions & 1 deletion TestGoogleCharsNGraphsControls/CHAP.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ private void ChapTimeline()
lst.Add(new GoogleChartsNGraphsControls.CHAPTimelineEvent(new DateTime(2015, 7, 27), "Bed Time!"));

this.CHAPTimeline1.ChartData(lst.ToArray());
this.CHAPTimeline1.GviOptionsOverride = "{}";
}
}
}

0 comments on commit f4cc4e4

Please sign in to comment.