private GenericStockChart CreateChart() { var model = new GenericStockChartViewModel(myModelSettings); model.Add(mySection.Chart); var chart = new GenericStockChart(model); chart.Width = ChartWidth; chart.Height = 450; return(chart); }
public void Render() { myContext.Document.WriteLine("<h2>{0}</h2>", mySection.Name); myChart = CreateChart(); myContext.Document.WriteLine("<div class=\"tabber\" style=\"width:" + myChart.Width + "px\">"); var max = mySection.Chart.Prices.Max(p => p.Time); RenderTab("5 days", new TimeRange(mySection.Chart.Prices[mySection.Chart.Prices.Count - 5].Time, max)); RenderTab("1 month", new TimeRange(max.AddMonths(-1), max)); RenderTab("3 month", new TimeRange(max.AddMonths(-3), max)); RenderTab("1 year", new TimeRange(max.AddYears(-1), max), isActive: true); RenderTab("3 year", new TimeRange(max.AddYears(-3), max)); RenderTab("all", new TimeRange(DateTime.MinValue, DateTime.MaxValue)); myContext.Document.WriteLine("</div>"); }