本文整理汇总了C#中Series类的典型用法代码示例。如果您正苦于以下问题:C# Series类的具体用法?C# Series怎么用?C# Series使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Series类属于命名空间,在下文中一共展示了Series类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComboHorizontal
public static void ComboHorizontal(dotnetCHARTING.Chart chart, int width, int height, string title, DataTable table, string xColumn, string yColumn)
{
SeriesCollection SC = new SeriesCollection();
Series s = new Series();
foreach (DataRow row in table.Rows)
{
string telType = row[xColumn].ToString();
Element e = new Element();
e.Name = telType;
e.LabelTemplate = "%PercentOfTotal";
e.YValue = Convert.ToDouble(row[yColumn].ToString());
s.Elements.Add(e);
}
SC.Add(s);
chart.TempDirectory = "temp";
chart.Use3D = false;
chart.DefaultAxis.Interval = 10;
chart.DefaultAxis.CultureName = "zh-CN";
chart.Palette = new Color[] { Color.FromArgb(49, 255, 49), Color.FromArgb(255, 255, 0), Color.FromArgb(255, 99, 49), Color.FromArgb(0, 156, 255) };
chart.DefaultElement.SmartLabel.AutoWrap = true;
chart.Type = ChartType.ComboHorizontal;
chart.Size = width + "x" + height;
chart.DefaultElement.SmartLabel.Text = "";
chart.Title = title;
chart.DefaultElement.ShowValue = true;
chart.PieLabelMode = PieLabelMode.Outside;
chart.ShadingEffectMode = ShadingEffectMode.Three;
chart.NoDataLabel.Text = "û��������ʾ";
chart.SeriesCollection.Add(SC);
}
示例2: InvalidAddition
public void InvalidAddition()
{
Series s1 = new Series(null,"cfs",TimeInterval.Daily);
Series s2 = new Series(null,"cfs",TimeInterval.Monthly);
Series s = s1 + s2;
}
示例3: Initialize
/// <summary>
/// Called at the start of your algorithm to setup your requirements:
/// </summary>
public override void Initialize()
{
//Set the date range you want to run your algorithm:
SetStartDate(startDate);
SetEndDate(endDate);
//Set the starting cash for your strategy:
SetCash(100000);
//Add any stocks you'd like to analyse, and set the resolution:
// Find more symbols here: http://quantconnect.com/data
AddSecurity(SecurityType.Equity, "SPY", resolution: Resolution.Minute);
//Chart - Master Container for the Chart:
Chart stockPlot = new Chart("Trade Plot");
//On the Trade Plotter Chart we want 3 series: trades and price:
Series buyOrders = new Series("Buy", SeriesType.Scatter, 0);
Series sellOrders = new Series("Sell", SeriesType.Scatter, 0);
Series assetPrice = new Series("Price", SeriesType.Line, 0);
stockPlot.AddSeries(buyOrders);
stockPlot.AddSeries(sellOrders);
stockPlot.AddSeries(assetPrice);
AddChart(stockPlot);
Chart avgCross = new Chart("Strategy Equity");
Series fastMA = new Series("FastMA", SeriesType.Line, 1);
Series slowMA = new Series("SlowMA", SeriesType.Line, 1);
avgCross.AddSeries(fastMA);
avgCross.AddSeries(slowMA);
AddChart(avgCross);
resamplePeriod = TimeSpan.FromMinutes((endDate - startDate).TotalMinutes / 2000);
}
示例4: ReadCorpsDataFile
public static Series ReadCorpsDataFile(string url, TimeInterval interval, params string[] headers)
{
string units = headers[headers.Length - 1];
if( units == "n (ft)") // hack for Banks Lake.
units = "(ft)";
Series rval = new Series(units, interval);
rval.HasFlags = true;
string fileName = FileUtility.GetTempFileName(".txt");
Web.GetTextFile(url, fileName, true);
int[] widths = new int[] { 9, 5, 9, 9, 9, 9, 9, 9, 9, 9, 9,9,9 };
var tf = new FixedWidthTextFile(fileName, widths);
int col, row;
tf.FindIndexToRange(headers, out row, out col);
if (row < 0 || col < 0)
{
Logger.WriteLine("Error: no index found for headers '" + String.Join("','", headers) + "'");
return rval;
}
rval.Name = String.Join(" ", headers, 0, headers.Length - 1);
ReadDataIntoSeries(tf, rval, row + headers.Length, col);
return rval;
}
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
WebChartControl chart = new WebChartControl();
chart.EnableViewState = false;
ChartTitle title = new ChartTitle();
title.Text = string.Format(Utilities.GetResourceString("Common", "ChartHeader"),
"Jmeno", "Start 10.12.2010","Finish 17.12.2010");
title.Font = new System.Drawing.Font("Tahoma", 10);
chart.Titles.Add(title);
chart.FillStyle.FillMode = FillMode.Solid;
Dictionary<int, Series> series = new Dictionary<int, Series>();
Series s0 = new Series("Recommended price", ViewType.StackedBar);
s0.ValueScaleType = ScaleType.Numerical;
s0.ArgumentScaleType = ScaleType.DateTime;
series.Add(0, s0);
SetGraphPoint(series[0], "rnd");
Series s1 = new Series("Actual price", ViewType.Line);
s1.ValueScaleType = ScaleType.Numerical;
s1.ArgumentScaleType = ScaleType.DateTime;
series.Add(1, s1);
SetGraphPoint(series[1], "fib");
//Series s2 = new Series("Predicted price", ViewType.Bubble);
//s2.ValueScaleType = ScaleType.Numerical;
//s2.ArgumentScaleType = ScaleType.DateTime;
//series.Add(2, s2);
//SetGraphPoint(series[2], "byte");
foreach (KeyValuePair<int, Series> serie in series)
chart.Series.Add(serie.Value);
//chart.SeriesTemplate.ShowInLegend = false;
chart.Legend.Direction = LegendDirection.LeftToRight;
chart.Legend.AlignmentHorizontal = LegendAlignmentHorizontal.Center;
chart.Legend.AlignmentVertical = LegendAlignmentVertical.Bottom;
DevExpress.XtraCharts.XYDiagram xyDiagram = new XYDiagram();
xyDiagram.AxisY.Title.Font = new System.Drawing.Font("Tahoma", 8);
xyDiagram.AxisY.Title.Text = "CZK";
xyDiagram.AxisY.Label.Staggered = false;
xyDiagram.AxisY.Title.Visible = true;
xyDiagram.AxisY.Range.SideMarginsEnabled = true;
xyDiagram.AxisY.Interlaced = true;
xyDiagram.AxisX.Title.Font = new System.Drawing.Font("Tahoma", 8);
xyDiagram.AxisX.Label.Staggered = true;
xyDiagram.AxisX.Range.SideMarginsEnabled = true;
xyDiagram.AxisX.Tickmarks.MinorVisible = false;
chart.Diagram = xyDiagram;
chart.Width = 700;
chart.Height = 500;
//chart.DataBind();
phMain.Controls.Add(chart);
}
示例6: CreateSeries
public static Series CreateSeries(string typechar, Dictionary<string, string> diction)
{
Series ser = null;
Dictionary<string, string> dicts = diction;
switch (typechar)
{
case "柱状图":
ser = new Series("", ViewType.Bar);
break;
case "线状图":
ser = new Series("", ViewType.Line);
break;
default:
ser = new Series("", ViewType.Bar);
break;
}
ser.ArgumentScaleType = ScaleType.Qualitative;
foreach (var item in dicts)
{
SeriesPoint sp = new SeriesPoint(item.Key, item.Value);
ser.Points.Add(sp);
}
SecondaryAxisY sy = new SecondaryAxisY();
sy.GridSpacing = 1;
return ser;
}
示例7: LoadSeries
public void LoadSeries(Series series, Piece piece)
{
if(piece != null)
{
if(AppGlobal.CollectionsViewInListMode)
{
AppGlobal.CollectionsViewInListMode = false;
}
}
ResolveSeriesViewController(series);
if(_vc.NavigationItem.TitleView != null)
{
_vc.NavigationItem.TitleView.Dispose();
_vc.NavigationItem.TitleView = null;
}
var label = new UILabel();
label.Font = UIFont.BoldSystemFontOfSize(14.0f);
label.BackgroundColor = UIColor.Clear;
label.TextColor = UIColor.White;
label.Text = series.Title;
label.SizeToFit();
_vc.NavigationItem.TitleView = label;
this.NavigationController.PushViewController(_vc, true);
if(piece != null)
{
_vc.GoToPiece(series, piece);
}
}
示例8: AddChartSeries
// Override the AddChartSeries method to provide the chart data
protected override void AddChartSeries()
{
ChartSeriesData = new List<Series>();
var series = new Series()
{
ChartType = SeriesChartType.Pie,
BorderWidth = 1
};
var shares = chartData.ShareData;
foreach (var share in shares)
{
var point = new DataPoint();
point.IsValueShownAsLabel = true;
point.AxisLabel = share.Name;
point.ToolTip = share.Name + " " +
share.Share.ToString("#0.##%");
if (share.Url != null)
{
point.MapAreaAttributes = "href=\"" +
share.Url + "\"";
}
point.YValues = new double[] { share.Share };
point.LabelFormat = "P1";
series.Points.Add(point);
}
ChartSeriesData.Add(series);
}
示例9: BindChart
private void BindChart(string seryName, Dictionary<string, int> pointValues)
{
Series se = new Series(seryName);
se.ChartType = SeriesChartType.Bar;
// se.ChartType = SeriesChartType.Column;
se.XValueType = ChartValueType.String;
Chart1.ChartAreas["ChartArea1"].AxisX.Interval = 1; // se.LabelFormat = "hh:mm:ss";
// se.Label = "#PERCENT{P2}";
//se["PieLabelStyle"] = "Outside";
// Chart1.Legends.Add("Legend1");
// Chart1.Legends[0].Enabled = true;
// Chart1.Legends[0].Docking = Docking.Bottom;
// Chart1.Legends[0].Alignment = System.Drawing.StringAlignment.Center;
//se.LegendText = "#PERCENT{P2}";
//一个point 表示该series在某点的数据
se.IsValueShownAsLabel = true;
se.Points.DataBindXY(pointValues.Keys,pointValues.Values );
Chart1.Series.Clear();
Chart1.Series.Add(se);
// Chart1.Series[0]["CollectedThresholdUsePercent"] = "true";
/*
Chart1.Series[0].Label = "#PERCENT{P2}";
Chart1.Series[0]["PieLabelStyle"] = "Outside";*/
}
示例10: FillColumnChart
public void FillColumnChart(DataTable DT)
{
dataGridView1.DataSource = DT;
dataGridView1.DataBind();
chart2.Series.Clear();
Series seriesAll = new Series("总收入");
chart2.Series.Add(seriesAll);
Series seriesLixi = new Series("利息");
chart2.Series.Add(seriesLixi);
Series seriesTouRu = new Series("本金");
chart2.Series.Add(seriesTouRu);
chart2.DataSource = DT;
//设置图表Y轴对应项
seriesAll.YValueMembers = "All";
seriesLixi.YValueMembers = "Lixi";
seriesTouRu.YValueMembers = "TouRu";
//设置图表X轴对应项
chart2.Series[0].XValueMember = "Time";
//chart2.ChartAreas[0].Area3DStyle.Enable3D = true;
//chart2.ChartAreas[0].Area3DStyle.Inclination = 30;
//chart2.ChartAreas[0].Area3DStyle.PointDepth = 50;
//chart2.ChartAreas[0].Area3DStyle.IsClustered = true;
//chart2.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
chart2.DataBind();
}
示例11: Below
public void Below()
{
var ds = db.Alarms;
ds.AddNewAlarmGroup("lucky");
ds.alarm_definition.Addalarm_definitionRow(true, "lucky",
"luc", "fb", "below 5525", "", 10);
ds.SaveTable(ds.alarm_definition);
ds.alarm_recipient.Addalarm_recipientRow("lucky", 4,
"5272", "office", "[email protected]");
ds.SaveTable(ds.alarm_recipient);
Series s = new Series();
s.Parameter = "fb";
s.SiteID = "luc";
s.Add(DateTime.Parse("2016-11-21 02:00"), 5520.12);
s.Add(DateTime.Parse("2016-11-21 02:15"), 5520.12);
s.Add(DateTime.Parse("2016-11-21 02:30"), 5520.12);
s.Add(DateTime.Parse("2016-11-21 02:45"), 5520.12);
ds.Check(s);
var queue = ds.GetAlarmQueue();
string sql = "list = 'lucky' AND siteid = 'luc' "
+ "AND parameter = 'fb' AND status = 'new'";
Assert.IsTrue(queue.Select(sql).Length == 1);
}
示例12: AboveOrRising
public void AboveOrRising()
{
var ds = db.Alarms;
ds.AddNewAlarmGroup("uny");
ds.alarm_definition.Addalarm_definitionRow(true, "uny",
"uny", "pc", "above 300 or rising 1", "", 10);
ds.SaveTable(ds.alarm_definition);
ds.alarm_recipient.Addalarm_recipientRow("uny", 4,
"5272", "office", "[email protected]");
ds.SaveTable(ds.alarm_recipient);
Series s = new Series();
s.Parameter = "pc";
s.SiteID = "uny";
s.Add(DateTime.Parse("2016-11-21 02:00"), 38002.12);
s.Add(DateTime.Parse("2016-11-21 02:15"), 38005.02);
s.Add(DateTime.Parse("2016-11-21 02:30"), 38002.02);
s.Add(DateTime.Parse("2016-11-21 02:45"), 38002.02);
ds.Check(s);
var queue = ds.GetAlarmQueue();
string sql = "list = 'uny' AND siteid = 'uny' "
+ "AND parameter = 'pc' AND status = 'new'";
Assert.IsTrue(queue.Select(sql).Length == 1);
}
示例13: Details
public ActionResult Details(int width = 500, int height = 500)
{
var chart = new Chart { Height = height, Width = width };
var chartArea = new ChartArea("Area1")
{
AxisX = { Interval = 1 },
Area3DStyle = { Enable3D = true },
BackColor = Color.Transparent
};
chart.ChartAreas.Add(chartArea);
chart.BackColor = Color.Transparent;
var seriescountAll = new Series("项目统计");
var countAll =
_iProjectInfoStateService.GetAll()
.Select(a => new { Key = a.ProjectInfoStateName, Count = a.ProjectInfos.Count(b => !b.Deleted) });
seriescountAll.ChartArea = "Area1";
seriescountAll.IsVisibleInLegend = true;
seriescountAll.IsValueShownAsLabel = true;
seriescountAll.Label = "#VALX #VALY";
seriescountAll.Points.DataBind(countAll, "Key", "Count", "");
seriescountAll.ChartType = SeriesChartType.Funnel;
chart.Series.Add(seriescountAll);
var imageStream = new MemoryStream();
chart.SaveImage(imageStream, ChartImageFormat.Png);
imageStream.Position = 0;
return new FileStreamResult(imageStream, "image/png");
}
示例14: EqualLengths
public void EqualLengths()
{
var pu = new Series("daily_wrdo_pu");
pu.TimeInterval = TimeInterval.Daily;
pu.Add("10-1-2014", 0);
pu.Add("10-2-2014", 1);
pu.Add("10-3-2014", 2);
pu.Add("10-4-2014", 3);
pu.Add("10-5-2014", 4);
pu.Add("10-6-2014", 5);
var pp = new Series("daily_wrdo_pp");
pp.TimeInterval = TimeInterval.Daily;
pp.Add("10-1-2014", 0);
pp.Add("10-2-2014", 1);
pp.Add("10-3-2014", 1);
pp.Add("10-4-2014", 1);
pp.Add("10-5-2014", 1);
pp.Add("10-6-2014", 1);
var puNew = Reclamation.TimeSeries.Math.DailyWaterYearRunningTotal(pp, pu);
for (int i = 0; i < pu.Count; i++)
{
Assert.AreEqual(puNew[i].Value, pu[i].Value);
}
}
示例15: Insert
public void Insert(Guid Guid, Guid ServerPartitionGUID, Guid StudyGUID, string SeriesInstanceUid,
string Modality, string SeriesNumber, string SeriesDescription,
int NumberOfSeriesRelatedInstances, string PerformedProcedureStepStartDate,
string PerformedProcedureStepStartTime, string SourceApplicationEntityTitle)
{
var item = new Series();
item.Guid = Guid;
item.ServerPartitionGUID = ServerPartitionGUID;
item.StudyGUID = StudyGUID;
item.SeriesInstanceUid = SeriesInstanceUid;
item.Modality = Modality;
item.SeriesNumber = SeriesNumber;
item.SeriesDescription = SeriesDescription;
item.NumberOfSeriesRelatedInstances = NumberOfSeriesRelatedInstances;
item.PerformedProcedureStepStartDate = PerformedProcedureStepStartDate;
item.PerformedProcedureStepStartTime = PerformedProcedureStepStartTime;
item.SourceApplicationEntityTitle = SourceApplicationEntityTitle;
item.Save(UserName);
}