Пример #1
0
        internal StockChartModel ConvertToModel()
        {
            StockChartModel chartModel = new StockChartModel();
            chartModel.StockId = StockId;

            if (StockMessage.Count > 0)
                chartModel.StockMessage = StockMessage[0].Convert();

            chartModel.ChartData = new List<ChartPointModel>();
            foreach (var point in ChartData)
                chartModel.ChartData.Add(point.Convert());

            return chartModel;
        }
 private void SetOpenCloseTimeToCharAxis(StockChartModel chartModel)
 {
     // set the start and end y axis
     if (chartModel.ChartData.Count > 0)
     {
         DateTime op = DateTimeUtils.UnixTimeStampToDateTime(Convert.ToDouble(chartModel.ChartData[0].Timestemp));
         DateTime clo = new DateTime(op.Year, op.Month, op.Day, 13, 30, 0);
         OpeningTimeAxis = DateTimeAxis.ToDouble(op);
         ClosingTimeAxis = DateTimeAxis.ToDouble(clo);
     }
 }