本文整理汇总了C#中commonClass.DataSeries.Add方法的典型用法代码示例。如果您正苦于以下问题:C# DataSeries.Add方法的具体用法?C# DataSeries.Add怎么用?C# DataSeries.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类commonClass.DataSeries
的用法示例。
在下文中一共展示了DataSeries.Add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeData
private static commonClass.DataSeries MakeData(databases.tmpDS.marketDataDataTable dataTbl, DataFields type)
{
commonClass.DataSeries ds = new commonClass.DataSeries();
switch (type)
{
case DataFields.Count:
for (int idx = 0; idx < dataTbl.Count; idx++) ds.Add(dataTbl[idx].val0); break;
case DataFields.Volume:
for (int idx = 0; idx < dataTbl.Count; idx++) ds.Add(dataTbl[idx].val1); break;
case DataFields.DateTime:
for (int idx = 0; idx < dataTbl.Count; idx++) ds.Add(dataTbl[idx].onDate.ToOADate()); break;
}
return ds;
}
示例2: DataSeries
public static DataSeries operator <<(DataSeries ds, int n)
{
DataSeries retVal = new DataSeries();
for (int idx = n; idx < ds.Count; idx++) retVal.Add(ds[idx]);
retVal.FirstValidValue = ds.FirstValidValue - n;
if (retVal.FirstValidValue < 0) retVal.FirstValidValue = 0;
return retVal;
}
示例3: PlotProfitChart
public void PlotProfitChart()
{
string saveSort = tradeEstimateSource.Sort;
tradeEstimateSource.Sort = "";
databases.tmpDS.tradeEstimateDataTable tbl = tradeEstimateSource.DataSource as databases.tmpDS.tradeEstimateDataTable;
chartPnl.ResetGraph();
chartPnl.RemoveAllCurves();
DataSeries xSeries = new DataSeries();
DataSeries ySeries = new DataSeries();
for (int idx = 0; idx < tbl.Count; idx++)
{
if (!allTransactionMenuItem.Checked && tbl[idx].ignored) continue;
ySeries.Add((double)tbl[idx].profit);
xSeries.Add(tbl[idx].onDate.ToOADate());
}
//Handle bug in graph for curve with only on point ????
if (ySeries.Count > 1)
{
chartPnl.myGraphObj.SetSeriesX(xSeries.Values, Charts.AxisType.DateAsOrdinal);
chartPnl.myGraphObj.SetFont(Settings.sysChartFontSize);
chartPnl.myGraphObj.ChartMarginTOP = constProfitChartMarginTOP;
chartPnl.myGraphObj.ChartMarginBOTTOM = constProfitChartMarginBOTTOM;
CurveItem curveItem = chartPnl.myGraphObj.AddCurveBar("profit", ySeries.Values, Settings.sysChartVolumesColor, Settings.sysChartVolumesColor, 1);
chartPnl.myGraphObj.DefaultViewport();
chartPnl.PlotGraph();
}
tradeEstimateSource.Sort = saveSort;
}