예제 #1
0
 public void RemoveStatSeries(StockStat stat)
 {
     for (int i = 0; i < stat.DataCount; i++)
     {
         PVChart.Series.Remove(PVChart.Series.FindByName(stat.ChartSeriesName(i)));
     }
 }
예제 #2
0
 public static void UpdateStatSeriesDefinition(this PriceVolumeChart chart, StockStat stat)
 {
     for (int i = 0; i < stat.DataCount; i++)
     {
         Series s = chart.GetSeries(stat.ChartSeriesName(i));
         s.Color = stat.DataColor[i];
     }
 }
 public Series CreateSeries(StockStat stat, int seriesIndex) => new Series(stat.ChartSeriesName(seriesIndex))
 {
     ChartArea       = stat.ChartArea,
     ChartType       = SeriesChartType.Line,
     Color           = stat.DataColor[seriesIndex],
     Font            = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))),
     IsXValueIndexed = true,
     YValueType      = ChartValueType.Single
 };
예제 #4
0
 public static void PrependStockStatData(this PriceVolumeChart chart, StockPricesData data, StockStat stat)
 {
     for (int i = 0; i < stat.DataCount; i++)
     {
         Series s = chart.GetSeries(stat.ChartSeriesName(i));
         s.Points.Clear();
     }
     AppendStockStatData(chart, data, stat);
 }
예제 #5
0
 public static void AppendStockStatData(this PriceVolumeChart chart, StockPricesData data, StockStat stat)
 {
     for (int i = 0; i < stat.DataCount; i++)
     {
         Series  s            = chart.GetSeries(stat.ChartSeriesName(i));
         float[] currdata     = stat.Data(i);
         int     tsstartindex = data.Length - currdata.Length;
         for (int j = 0; j < tsstartindex; j++)
         {
             int ix = s.Points.AddXY(data.TS[j], 0);
             s.Points[ix].IsEmpty = true;
         }
         for (int j = 0; j < currdata.Length; j++)
         {
             s.Points.AddXY(data.TS[tsstartindex + j], currdata[j]);
         }
     }
 }