本文整理汇总了C#中System.Windows.Forms.DataVisualization.Charting.Series类的典型用法代码示例。如果您正苦于以下问题:C# Series类的具体用法?C# Series怎么用?C# Series使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Series类属于System.Windows.Forms.DataVisualization.Charting命名空间,在下文中一共展示了Series类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Graph
/// <summary>
/// Constructor
/// </summary>
/// <param name="graphVisualizer"></param>
public Graph(GraphVisualizer graphVisualizer)
{
GraphVisualizer = graphVisualizer;
Data = new Series();
GraphVisualizer.Series.Add(Data);
}
开发者ID:JamesOakey,项目名称:ERTMSFormalSpecs,代码行数:11,代码来源:Graph.cs
示例2: AddChartToForm
private Chart AddChartToForm(ChartData chartData)
{
var chart = new Chart { Dock = DockStyle.Fill, BackColor = Color.White };
var title = new Title(chartData.ToString()) { Font = new Font("Verdana", 14.0f) };
chart.Titles.Add(title);
chart.Legends.Add(new Legend("Legend"));
var area = new ChartArea("Main")
{
BackColor = Color.White,
BackSecondaryColor = Color.LightSteelBlue,
BackGradientStyle = GradientStyle.DiagonalRight,
AxisY = { Maximum = 100 },
AxisY2 = { Maximum = 20 }
};
area.AxisX.MajorGrid.LineColor = Color.LightSlateGray;
area.AxisX.TitleFont = new Font("Verdana", 10.0f, FontStyle.Bold);
area.AxisX.Title = "Date";
area.AxisY.MajorGrid.LineColor = Color.LightSlateGray;
area.AxisY.TitleFont = new Font("Verdana", 10.0f, FontStyle.Bold);
area.AxisY.Title = "Weight";
area.AxisY2.Title = "Reps";
chart.ChartAreas.Add(area);
var seriesColumns1 = new Series("Weights") { ChartType = SeriesChartType.Line, IsValueShownAsLabel = true };
chart.Series.Add(seriesColumns1);
var seriesColumns2 = new Series("Reps") { ChartType = SeriesChartType.Line };
chart.Series.Add(seriesColumns2);
Controls.Add(chart);
return chart;
}
开发者ID:gmoller,项目名称:GymWorkoutTracker,代码行数:35,代码来源:ChartControl.cs
示例3: Make
public void Make(List<int> values, List<string> answerNames, string question)
{
//clear the chart
chart1.Series.Clear();
Dictionary<string, int> Columns = new Dictionary<string, int>();
List<Color> Colors = new List<Color>() {
Color.Black, Color.Blue, Color.Red, Color.Green, Color.Pink
};
//initialize new instances for a diagram
Series series = new Series();
series.ChartArea = "ChartArea1";
chart1.ChartAreas["ChartArea1"].RecalculateAxesScale();
series.IsVisibleInLegend = false;
//add columns to the diagram
for (int i = 0; i < answerNames.Count; i++)
{
series.Points.AddXY(answerNames[i], values[i]);
//give color to each individual column
series.Points[i].Color = (i < 5) ? Colors[i] : Colors[(int)Math.Floor(((double)i / 5))];
}
chart1.Series.Add(series);
//add question above the diagram
labelQuestion.Text = question;
}
开发者ID:1337Steven1337,项目名称:KBS2G3,代码行数:27,代码来源:DiagramView.cs
示例4: btnFindOptimalLocation_Click
private void btnFindOptimalLocation_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
DiscretizationStep = Convert.ToDouble(tbDiscretizationStep.Text);
SourceMovingStep = Convert.ToDouble(tbSourceMovingStep.Text);
StepDecreasingMultiplier = Convert.ToDouble(tbStepDecreasingMultiplier.Text);
StepMinimum = Convert.ToDouble(tbStepMinimum.Text);
EpsKlepper = Convert.ToDouble(tbEps.Text);
var optimalLocation = KlepperAlgorithm.FindOptimalAllocation(
DiscreteSet,
InitialSourceSet,
DiscretizationStep,
SourceMovingStep,
StepDecreasingMultiplier,
StepMinimum,
EpsKlepper
);
var y = new Series();
y.Color = Color.OrangeRed;
y.ChartType = SeriesChartType.Point;
y.MarkerStyle = MarkerStyle.Circle;
y.Name = "Оптимальное размещение по алгоритму Клеппера";
foreach (var point in optimalLocation)
y.Points.AddXY(point.X, point.Y);
chAlgorithms.Series.Add(y);
tbMu.Text = KlepperAlgorithm.Mu.ToString();
this.Cursor = Cursors.Default;
}
开发者ID:NataGrankina,项目名称:Diploma,代码行数:33,代码来源:AreaForm.cs
示例5: FillColumnChart
public void FillColumnChart(DataTable DT)
{
dataGridView1.DataSource = DT;
chart2.Series.Clear();
Series seriesAll = new Series("总收入");
chart2.Series.Add(seriesAll);
Series seriesLixi = new Series("利息");
chart2.Series.Add(seriesLixi);
chart2.DataSource = DT;
//设置图表Y轴对应项
seriesAll.YValueMembers = "All";
seriesLixi.YValueMembers = "Lixi";
//设置图表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();
}
开发者ID:wgang10,项目名称:XTHospatal,代码行数:28,代码来源:FormLiLv.cs
示例6: CreateSeries
protected virtual void CreateSeries() {
Series bestKnown = new Series("Alleles of Best Known Solution");
bestKnown.ChartType = SeriesChartType.Column;
bestKnown.XValueType = ChartValueType.String;
bestKnown.YValueType = ChartValueType.Double;
bestKnown.YAxisType = AxisType.Primary;
chart.Series.Add(bestKnown);
Series others = new Series("Other Alleles");
others.ChartType = SeriesChartType.Column;
others.XValueType = ChartValueType.String;
others.YValueType = ChartValueType.Double;
others.YAxisType = AxisType.Primary;
chart.Series.Add(others);
invisibleSeries.Add(others);
Series qualities = new Series("Average Solution Qualities");
qualities.ChartType = SeriesChartType.FastPoint;
qualities.XValueType = ChartValueType.String;
qualities.YValueType = ChartValueType.Double;
qualities.YAxisType = AxisType.Secondary;
chart.Series.Add(qualities);
Series impacts = new Series("Average Impact");
impacts.ChartType = SeriesChartType.FastPoint;
impacts.XValueType = ChartValueType.String;
impacts.YValueType = ChartValueType.Double;
impacts.YAxisType = AxisType.Secondary;
chart.Series.Add(impacts);
}
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:30,代码来源:AlleleFrequencyCollectionView.cs
示例7: Init
public void Init(StatisticsCollection collection, Core core)
{
mCore = core;
mCollection = collection;
foreach (var name in collection.StatisticsNames) {
Series current = new Series(name, 100);
Series mean = new Series(name + " Mean", 100);
current.ChartType = SeriesChartType.Line;
mean.ChartType = SeriesChartType.Line;
sharedGraph.Series.Add(current);
sharedGraph.Series.Add(mean);
namesList.Items.Add(name);
ListViewItem row = new ListViewItem(name);
//row.SubItems.Add(name);
row.SubItems.Add("0");
row.SubItems.Add("0");
row.SubItems.Add("0");
row.SubItems.Add("0");
statsList.Items.Add(row);
mCurrentSeries.Add(name, current);
mMeanSeries.Add(name, mean);
mRows.Add(name, row);
}
}
开发者ID:JohnMcCaffery,项目名称:ChimeraClean,代码行数:30,代码来源:StatisticsCollectionPanel.cs
示例8: chartForecastTestNumberbyduration_Load
private void chartForecastTestNumberbyduration_Load(object sender, EventArgs e)
{
GetSummary();
GetForecastSummaryData(_dataSet);
lqtChart2.Series.Clear();
IList<string> UniqueTestingAreas=new List<string>();
foreach (ForecastSummaryData fsd in _fSummaryData)
{
if(!UniqueTestingAreas.Contains(fsd.TestingArea))
UniqueTestingAreas.Add(fsd.TestingArea);
}
foreach (string ta in UniqueTestingAreas)
{
Series series = new Series(ta);
series.ChartType = SeriesChartType.Line;
series.IsValueShownAsLabel = chkshowlabel.Checked;
lqtChart2.Series.Add(series);
IList<ForecastSummaryData> currentSummary = GetForecastSummaryByTA(ta);
foreach (ForecastSummaryData fsd in currentSummary)
{
lqtChart2.Series[ta].Points.AddXY(fsd.DurationDateTime, fsd.NoOfTest);
}
}
lqtChart2.Titles[0].Text = _chartTitle;
}
开发者ID:opianHealth,项目名称:ForLAB,代码行数:29,代码来源:chartForecastTestNumberbyduration.cs
示例9: AddPoints
public void AddPoints(IEnumerable<int> points, Color? color = null)
{
var chartPoints = new Series { ChartType = SeriesChartType.Point, MarkerSize = 7, IsVisibleInLegend = false};
if (color.HasValue) chartPoints.Color = color.Value;
foreach (var point in points) chartPoints.Points.AddXY(point, 0);
Series.Add(chartPoints);
}
开发者ID:shmatov,项目名称:time-series-forecasting,代码行数:7,代码来源:Report.cs
示例10: chart1_Load
private void chart1_Load(object sender, EventArgs e)
{
var listOfPeople = new People().GetPopleFromTextFile();
var list = new List<int>();
// chart1.BackColor=System.Drawing.Color.Black;
chart1.Titles.Add("People Alive");
foreach (var person in listOfPeople)
{
list.Add(person.end);
// Add point.
}
chart1.Series.Clear();
var series1 = new System.Windows.Forms.DataVisualization.Charting.Series
{
Name = "Age",
Color = System.Drawing.Color.Green,
IsVisibleInLegend = true,
IsXValueIndexed = true,
ChartType = SeriesChartType.Bar
};
this.chart1.Series.Add(series1);
foreach (var person in listOfPeople)
{
int age = person.end - person.Birth;
series1.Points.AddXY(person.end, age);
}
}
开发者ID:AditiAnand8,项目名称:PeopleYear,代码行数:33,代码来源:chart.cs
示例11: AddPlot
public void AddPlot(List<double> values, string title = "")
{
Chart chart = new Chart();
Series series = new Series();
ChartArea chartArea1 = new ChartArea();
chartArea1.Name = "ChartArea1";
chart.ChartAreas.Add(chartArea1);
series.BorderWidth = 2;
series.BorderDashStyle = ChartDashStyle.Solid;
series.ChartType = SeriesChartType.Line;
series.Color = Color.Green;
for (int i = 0; i < values.Count; i++)
{
series.Points.AddXY(i, values[i]);
}
chart.BorderlineColor = Color.Red;
chart.BorderlineWidth = 1;
chart.Series.Add(series);
chart.Titles.Add(title);
chart.Invalidate();
chart.Palette = ChartColorPalette.Fire;
chartArea1.AxisY.Minimum = values.Min();
chartArea1.AxisY.Maximum = values.Max();
AddChartInRuntime(chart);
}
开发者ID:Spawek,项目名称:trendpredictortester,代码行数:25,代码来源:Plotter.cs
示例12: btnShowCorrelogram_Click
private void btnShowCorrelogram_Click(object sender, EventArgs e)
{
var ts = new TimeSeries(TimeSeriesEnvironment.Current.TimeSeries, false);
int k;
if (!int.TryParse(txtCorrelogramK.Text, out k) || k < 0 || k > ts.Count - 1)
{
MessageBox.Show("Incorrect K variable for processing correlogram.");
return;
}
var cor = RandomExcerptChecker.GetCorrelogram(ts.Excerpt, k);
Series crlgrm = new Series("TS Correlogram")
{
ChartType = SeriesChartType.Column
};
dgCorrelation.Rows.Clear();
for (int i = 0; i < cor.Count; i++)
{
crlgrm.Points.AddXY(i, cor[i]);
var res = RandomExcerptChecker.TestCorrelation(cor[i], ts.Count, i);
dgCorrelation.Rows.Add(i,
string.Format("|{0:0.0000}|", res.Statistics),
res.IsRandom ? "≤" : ">",
res.Quantile.ToString("0.0000"));
}
chartTS.Series.Clear();
chartTS.Series.Add(crlgrm);
chartTS.ResetAutoValues();
}
开发者ID:SanyoGorbunov,项目名称:univer-projects,代码行数:33,代码来源:Main.cs
示例13: button1_Click
private void button1_Click(object sender, EventArgs e)
{
// generate URL
string brand = comboBox1.Text;
string fromDate = comboBox2.Text + "-" + comboBox3.Text + "-" + comboBox4.Text;
string toDate = comboBox7.Text + "-" + comboBox6.Text + "-" + comboBox5.Text;
string url = "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%20%3D%20%22"
+ brand + "%22%20and%20startDate%20%3D%20%22"
+ fromDate + "%22%20and%20endDate%20%3D%20%22"
+ toDate + "%22&format=xml&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys";
// get and parse XML
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
string xml = wc.DownloadString(url);
XDocument doc = XDocument.Parse(xml);
// set chart data
Series chartSetting = new Series();
chartSetting.ChartType = SeriesChartType.Line;
var quotes = doc.Descendants("quote");
foreach (var quote in quotes)
chartSetting.Points.AddXY(quote.Element("Date").Value, quote.Element("Close").Value);
chart1.Series.Clear();
chart1.Series.Add(chartSetting);
chart1.ChartAreas[0].AxisX.IsReversed = true;
}
开发者ID:k-hnd,项目名称:FinanceChart,代码行数:28,代码来源:Form1.cs
示例14: CenterGravity
public CenterGravity()
{
InitializeComponent();
Chart chart = new Chart();
ChartArea area = new ChartArea();
area.AxisX.Title = "t";
area.AxisX.Minimum = 0;
area.AxisX.MajorGrid.LineColor = Color.LightGray;
area.AxisY.Title = "Movement";
area.AxisY.MajorGrid.LineColor = Color.LightGray;
chart.ChartAreas.Add(area);
_serie = new Series();
_serie.ChartType = SeriesChartType.Line;
_serie.MarkerStyle = MarkerStyle.Diamond;
_serie.MarkerSize = 9;
_serie.Color = Color.LimeGreen;
chart.Series.Add(_serie);
WindowsFormsHost host = new WindowsFormsHost();
host.Child = chart;
movlive.Children.Add(host);
_cog = new cog(400, 400);
coglive.Children.Add(_cog);
_first = true;
MainController.GetInstance.DataController.AddSensorDataListener(this);
}
开发者ID:simonmoosbrugger,项目名称:SmartChair,代码行数:30,代码来源:CenterGravity.xaml.cs
示例15: ActualizeStats
public void ActualizeStats(Dictionary<string, int> ressourcesGathered)
{
if (GatherPie.InvokeRequired)
{
Invoke(new DelegGatherPie(ActualizeStats), ressourcesGathered);
return;
}
if (GatherPie.Titles.Count < 1)
GatherPie.Titles.Add("Ressources");
GatherPie.Series.Clear();
GatherPie.ChartAreas[0].BackColor = Color.Transparent;
Series series1 = new Series
{
Name = "series1",
IsVisibleInLegend = true,
Color = System.Drawing.Color.DeepSkyBlue,
ChartType = SeriesChartType.Pie
};
GatherPie.Series.Add(series1);
for (int z = 0; z < ressourcesGathered.Keys.Count; z++)
{
if (!job.CanGatherThis(ressourcesGathered.Keys.ToList()[z]))
ressourcesGathered.Remove(ressourcesGathered.Keys.ToList()[z]);
}
int i =0;
foreach (KeyValuePair<string,int> pair in ressourcesGathered)
{
series1.Points.Add(pair.Value);
var p1 = series1.Points[i];
p1.AxisLabel = pair.Key + " (" + pair.Value + ")";
p1.LegendText = pair.Key;
i += 1;
}
GatherPie.Invalidate();
}
开发者ID:DjTrilogic,项目名称:BlueSheep,代码行数:35,代码来源:JobUC.cs
示例16: AddSeries
public void AddSeries(Chart chart, string seriesName)
{
Series s = new Series(seriesName);
chart.Series.Add(s);
chart.Series[seriesName].ChartType = SeriesChartType.Column;
chart.Series[seriesName]["DrawingStyle"] = "Emboss";
}
开发者ID:iProcyonidae,项目名称:MVS,代码行数:7,代码来源:Palettes.cs
示例17: createCandleStickChart
/// <summary>
/// Creates the candlestick chart to be populated with stock data
/// </summary>
public void createCandleStickChart()
{
// clear out any existing chart series
candleStickChart.Series.Clear();
volumeChart.Series.Clear();
// create new series and add them to the charts
Series candleStick = new Series("Stocks");
candleStickChart.Series.Add(candleStick);
Series volume = new Series("Volume");
volumeChart.Series.Add(volume);
// set the chart types of candlestick and volume charts
candleStickChart.Series["Stocks"].ChartType = SeriesChartType.Candlestick;
volumeChart.Series["Volume"].ChartType = SeriesChartType.Column;
// Set the colors of price up and price down
candleStickChart.Series["Stocks"]["PriceUpColor"] = "Green";
candleStickChart.Series["Stocks"]["PriceDownColor"] = "Red";
// Show both open and close marks
candleStickChart.Series["Stocks"]["ShowOpenClose"] = "Both";
// Set maximum pixel point width
candleStickChart.Series["Stocks"]["MaxPixelPointWidth"] = "10";
// Set the style of the open-close marks
candleStickChart.Series["Stocks"]["OpenCloseStyle"] = "Triangle";
}
开发者ID:rcharp,项目名称:yahoo-stock,代码行数:33,代码来源:Form2.cs
示例18: Plot
/// <summary>
/// Helper function for plotting.
/// </summary>
private void Plot(string indexColumnName, IDataFrame dataFrame)
{
var indexValues = dataFrame.GetColumn(indexColumnName).AsDate().ToValues();
var remainingColumns = dataFrame.DropColumn("index").GetColumns();
var allSeriesData = remainingColumns
.Select(column =>
{
var label = column.GetName();
var entries = LinqExts.Zip(
indexValues,
column.AsFloat().ToValues(),
(index, value) => new { index, value }
)
.ToArray();
return new { label, entries };
})
.ToArray();
foreach (var seriesData in allSeriesData)
{
var series = new Series(seriesData.label);
foreach (var entry in seriesData.entries)
{
series.Points.AddXY(entry.index, entry.value);
}
chart1.Series.Add(series);
}
}
开发者ID:data-forge,项目名称:data-forge-cs,代码行数:34,代码来源:Form1.cs
示例19: DrawBinomial
private void DrawBinomial(int n, int y, string Name)
{
Series series = new Series(Name);
series.BorderWidth = 3;
series.ChartType = SeriesChartType.Spline;
double MaxValue = 0;
double Temp = 0;
for (double i = 0.01; i < 1; i = i + 0.05)
{
Temp = n * Stat.BinomialPDF(i,n,y);
if (MaxValue < Temp)
{
MaxValue = Temp;
}
series.Points.AddXY(i,Temp );
}
chart_PosteriorDensity.Series.Add(series);
var XAxis = chart_PosteriorDensity.ChartAreas[0].AxisX;
XAxis.MajorGrid.Enabled = false;
var YAxis = chart_PosteriorDensity.ChartAreas[0].AxisY;
YAxis.MajorGrid.Enabled = false;
XAxis.Maximum = 1;
XAxis.Minimum = 0;
YAxis.Maximum = Math.Ceiling(MaxValue);
}
开发者ID:JoshuaHe2015,项目名称:VISAP2.0_GUI,代码行数:26,代码来源:BetaPosterior.cs
示例20: processList_ItemCheck
private void processList_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
{
string[] spliters = { "-" };
string value = processList.Items[e.Index].ToString();
string instanceName = value.Split(spliters, StringSplitOptions.None).FirstOrDefault();
this.createperfcounter(instanceName);
Series series = new Series(instanceName);
series.ChartType = SeriesChartType.FastLine;
series.BorderWidth = 5;
Series cpuseries = new Series(instanceName);
cpuseries.ChartType = SeriesChartType.FastLine;
cpuseries.BorderWidth = 5;
chart1.Series.Add(series);
chart2.Series.Add(cpuseries);
}
}
开发者ID:No9,项目名称:nodejsdublin-28-06-2012,代码行数:31,代码来源:Form1.cs
注:本文中的System.Windows.Forms.DataVisualization.Charting.Series类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论