本文整理汇总了C#中LineSeries类的典型用法代码示例。如果您正苦于以下问题:C# LineSeries类的具体用法?C# LineSeries怎么用?C# LineSeries使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LineSeries类属于命名空间,在下文中一共展示了LineSeries类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ViewChart
public ViewChart(Group current)
{
this.model = new PlotModel("Postęp nauki dla "+current.Name);
LineSeries basicSerie = new LineSeries("Postęp nauki");
LinearAxis ax = new LinearAxis();
ax.Unit = "%";
ax.Title = "Poprawne odpowiedzi";
model.Axes.Add(ax);
SqlAccess sql = new SqlAccess();
basicSerie.Smooth = true;
List<double> list = sql.GetStatsForGroup(current);
int i = 1;
if(list.Count>0)
basicSerie.Points.Add(new DataPoint(0.0,0));
basicSerie.MarkerType = MarkerType.Circle;
basicSerie.MarkerSize = 3;
basicSerie.SelectionMode = SelectionMode.Single;
foreach (double d in list)
{
basicSerie.Points.Add(new DataPoint(i,d));
i++;
}
this.model.Series.Add(basicSerie);
}
开发者ID:kajzur,项目名称:language-worker,代码行数:28,代码来源:ViewChart.cs
示例2: LineSerieswithcustomTrackerFormatString
public static PlotModel LineSerieswithcustomTrackerFormatString()
{
var plotModel1 = new PlotModel();
plotModel1.Subtitle = "TrackerFormatString = \"X={2:0.0} Y={4:0.0}\"";
plotModel1.Title = "LineSeries with custom TrackerFormatString";
var linearAxis1 = new LinearAxis();
linearAxis1.Position = AxisPosition.Bottom;
plotModel1.Axes.Add(linearAxis1);
var linearAxis2 = new LinearAxis();
plotModel1.Axes.Add(linearAxis2);
var lineSeries1 = new LineSeries();
lineSeries1.TrackerFormatString = "X={2:0.0} Y={4:0.0}";
lineSeries1.Points.Add(new DataPoint(0, 20));
lineSeries1.Points.Add(new DataPoint(10, 21));
lineSeries1.Points.Add(new DataPoint(20, 24));
lineSeries1.Points.Add(new DataPoint(30, 22));
lineSeries1.Points.Add(new DataPoint(40, 17));
lineSeries1.Points.Add(new DataPoint(50, 21));
lineSeries1.Points.Add(new DataPoint(60, 23));
lineSeries1.Points.Add(new DataPoint(70, 27));
lineSeries1.Points.Add(new DataPoint(80, 27));
lineSeries1.Points.Add(new DataPoint(90, 22));
lineSeries1.Points.Add(new DataPoint(100, 25));
plotModel1.Series.Add(lineSeries1);
return plotModel1;
}
开发者ID:airaultf,项目名称:ProjetDotNet,代码行数:26,代码来源:Window1.xaml.cs
示例3: InitializeChart
private void InitializeChart()
{
plotView = FindViewById<PlotView>(Resource.Id.plotView);
normalPointsSeries = new LineSeries();
// Set up our graph
plotView.Model = new PlotModel();
plotView.Model.Series.Add(normalPointsSeries);
plotView.Model.Axes.Add(new LinearAxis
{
Position = AxisPosition.Left,
Minimum = 0,
Maximum = 100,
IsZoomEnabled = false,
IsPanEnabled = false
});
plotView.Model.Axes.Add(new LinearAxis
{
Position = AxisPosition.Bottom,
IsZoomEnabled = false,
IsPanEnabled = false
});
UpdateChart();
}
开发者ID:TkachenkoRoman,项目名称:XamarinClient,代码行数:26,代码来源:MainActivity.cs
示例4: CPlot
public CPlot() {
plotModel = new PlotModel();
plotModel.Title = "Trigonometric functions";
plotModel.Subtitle = "Example using the FunctionSeries";
plotModel.PlotType = PlotType.XY;// Cartesian
plotModel.Background = OxyColors.White;
plotModel.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
plotModel.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
mCountNormalPackets = new LineSeries {
MarkerType = MarkerType.Circle,
MarkerSize = 4,
MarkerStroke = OxyColors.White,
};
mCountWarningPackets = new LineSeries();
mCountErrorPackets = new LineSeries();
plotModel.Series.Add(mCountNormalPackets);
plotModel.Series.Add(mCountWarningPackets);
plotModel.Series.Add(mCountErrorPackets);
}
开发者ID:yuraklb,项目名称:AISModel,代码行数:26,代码来源:CPlot.cs
示例5: GraphComponents
public GraphComponents(OxyColor color)
{
scatters = new ScatterSeries
{
BinSize = 8,
MarkerFill = color,
MarkerSize = 2.0,
MarkerStroke = color,
MarkerStrokeThickness = 1.0,
MarkerType = MarkerType.Circle
};
lines = new LineSeries
{
Color = color,
LineStyle = LineStyle.Solid,
StrokeThickness = 1.0,
Smooth = true
};
stems = new StemSeries
{
Color = color,
StrokeThickness = 1.0,
};
}
开发者ID:dobragab,项目名称:MouseTester,代码行数:26,代码来源:GraphComponents.cs
示例6: createChart
private RadCartesianChartView createChart(){
RadCartesianChartView chart = new RadCartesianChartView(this.Activity);
CategoricalAxis horizontalAxis = new CategoricalAxis();
chart.HorizontalAxis = horizontalAxis;
LinearAxis vertical1 = new LinearAxis();
vertical1.LabelFormat = "%.0f";
LinearAxis vertical2 = new LinearAxis();
vertical2.LabelFormat = "%.0f";
BarSeries series1 = new BarSeries();
ArrayList data = this.getData();
series1.ValueBinding = new ValueBinding1();
series1.CategoryBinding = new CategoryBinding();
series1.VerticalAxis = vertical1;
series1.Data = data;
chart.Series.Add(series1);
LineSeries series2 = new LineSeries();
series2.ValueBinding = new ValueBinding2();
series2.CategoryBinding = new CategoryBinding();
series2.VerticalAxis = (vertical2);
vertical2.HorizontalLocation = AxisHorizontalLocation.Right;
series2.Data = data;
chart.Series.Add(series2);
return chart;
}
开发者ID:bmccool,项目名称:Android-samples,代码行数:35,代码来源:MultipleAxesFragment.cs
示例7: PointsGraphWindow
public PointsGraphWindow()
{
InitializeComponent();
listBox.ItemsSource = lbxpts;
GraphModel = new PlotModel();
var sr = new LineSeries();
sr.Color = OxyColors.Green;
sr.MarkerType = MarkerType.Circle;
sr.MarkerFill = OxyColors.SteelBlue;
var sri = new LineSeries();
sri.Color = OxyColors.Red;
sri.Smooth = true;
sri.IsVisible = false;
GraphModel.Series.Add(sr);
GraphModel.Series.Add(sri);
chartCanvas.InvalidatePlot();
GraphModel.Axes.Add(new LinearAxis
{
MajorGridlineStyle = LineStyle.Solid,
MinorGridlineStyle = LineStyle.Solid,
MinorTickSize = 0,
Title = "y"
});
GraphModel.Axes.Add(new LinearAxis
{
MajorGridlineStyle = LineStyle.Solid,
MinorGridlineStyle = LineStyle.Solid,
MinorTickSize = 0,
Position = AxisPosition.Bottom,
Title = "x"
});
txtX.ItemsSource = Funcs;
txtY.ItemsSource = Funcs;
}
开发者ID:zdimension,项目名称:IMPression,代码行数:35,代码来源:PointsGraphWindow.xaml.cs
示例8: DaylightSavingsBreak
public static PlotModel DaylightSavingsBreak()
{
var m = new PlotModel();
var xa = new DateTimeAxis { Position = AxisPosition.Bottom };
#if PCL || SILVERLIGHT
// TimeZone not available in PCL...
#else
xa.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(
"W. Europe Standard Time");
#endif
m.Axes.Add(xa);
m.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
var ls = new LineSeries { MarkerType = MarkerType.Circle };
m.Series.Add(ls);
// set the origin of the curve to 2013-03-31 00:00:00 (UTC)
var o = new DateTime(2013, 3, 31, 0, 0, 0, DateTimeKind.Utc);
// add points at 10min intervals
// at 2am the clocks are turned forward 1 hour (W. Europe Standard Time)
for (int i = 0; i < 400; i += 10)
{
var time = o.AddMinutes(i);
ls.Points.Add(DateTimeAxis.CreateDataPoint(time, i));
}
return m;
}
开发者ID:gutyoh,项目名称:oxyplot,代码行数:29,代码来源:DateTimeAxisExamples.cs
示例9: TargetProbabilityLine
private LineSeries TargetProbabilityLine(Double target)
{
LineSeries result = new LineSeries(OxyColors.Red, title: "1/m");
result.Points.Add(new DataPoint(-1.0, target));
result.Points.Add(new DataPoint( 20.0, target));
return result;
}
开发者ID:romannort,项目名称:Modeling.LabOne,代码行数:7,代码来源:MainWindow.xaml.cs
示例10: Open
public void Open(string file)
{
var doc = new CsvDocument();
doc.Load(file);
var tmp = new PlotModel
{
Title = Path.GetFileNameWithoutExtension(file),
LegendPosition = LegendPosition.RightTop,
LegendPlacement = LegendPlacement.Outside,
PlotMargins = new OxyThickness(50, 0, 0, 40)
};
for (int i = 1; i < doc.Headers.Length; i++)
{
var ls = new LineSeries { Title = doc.Headers[i] };
foreach (var item in doc.Items)
{
double x = this.ParseDouble(item[0]);
double y = this.ParseDouble(item[i]);
ls.Points.Add(new DataPoint(x, y));
}
tmp.Series.Add(ls);
}
tmp.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Title = doc.Headers[0] });
this.Model = tmp;
}
开发者ID:huoxudong125,项目名称:oxyplot,代码行数:27,代码来源:MainViewModel.cs
示例11: CreatePlotModel
private static PlotModel CreatePlotModel(string title, string subtitle)
{
// Create the plot model
var tmp = new PlotModel { Title = title, Subtitle = subtitle };
tmp.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom });
tmp.Axes.Add(new LinearAxis { Position = AxisPosition.Left });
// Create two line series (markers are hidden by default)
var series1 = new LineSeries { Title = "Series 1", MarkerType = MarkerType.Circle };
series1.Points.Add(new DataPoint(0, 0));
series1.Points.Add(new DataPoint(10, 18));
series1.Points.Add(new DataPoint(20, 12));
series1.Points.Add(new DataPoint(30, 8));
series1.Points.Add(new DataPoint(40, 15));
var series2 = new LineSeries { Title = "Series 2", MarkerType = MarkerType.Square };
series2.Points.Add(new DataPoint(0, 4));
series2.Points.Add(new DataPoint(10, 12));
series2.Points.Add(new DataPoint(20, 16));
series2.Points.Add(new DataPoint(30, 25));
series2.Points.Add(new DataPoint(40, 5));
// Add the series to the plot model
tmp.Series.Add(series1);
tmp.Series.Add(series2);
// Axes are created automatically if they are not defined
return tmp;
}
开发者ID:huoxudong125,项目名称:oxyplot,代码行数:30,代码来源:MainViewModel.cs
示例12: MainViewModel
/// <summary>
/// Initializes a new instance of the <see cref="MainViewModel" /> class.
/// </summary>
public MainViewModel()
{
// Create the plot model
var tmp = new PlotModel { Title = "Simple example", Subtitle = "using OxyPlot" };
// Create two line series (markers are hidden by default)
var series1 = new LineSeries { Title = "Series 1", MarkerType = MarkerType.Circle };
series1.Points.Add(new DataPoint(0, 0));
series1.Points.Add(new DataPoint(10, 18));
series1.Points.Add(new DataPoint(20, 12));
series1.Points.Add(new DataPoint(30, 8));
series1.Points.Add(new DataPoint(40, 15));
var series2 = new LineSeries { Title = "Series 2", MarkerType = MarkerType.Square };
series2.Points.Add(new DataPoint(0, 4));
series2.Points.Add(new DataPoint(10, 12));
series2.Points.Add(new DataPoint(20, 16));
series2.Points.Add(new DataPoint(30, 25));
series2.Points.Add(new DataPoint(40, 5));
// Add the series to the plot model
tmp.Series.Add(series1);
tmp.Series.Add(series2);
// Axes are created automatically if they are not defined
// Set the Model property, the INotifyPropertyChanged event will make the WPF Plot control update its content
this.Model = tmp;
}
开发者ID:benjaminrupp,项目名称:oxyplot,代码行数:32,代码来源:MainViewModel.cs
示例13: LineLegendPositionAtEnd
public static PlotModel LineLegendPositionAtEnd()
{
// http://www.perceptualedge.com/example2.php
var model = new PlotModel { Title = "Average (Mean) monthly temperatures in 2003", PlotMargins = new OxyThickness(60, 4, 60, 40), PlotAreaBorderThickness = new OxyThickness(0), IsLegendVisible = false };
const string TrackerFormatString = "{0}: {4:0.0}ºF";
var phoenix = new LineSeries { Title = "Phoenix", LineLegendPosition = LineLegendPosition.End, TrackerFormatString = TrackerFormatString };
var raleigh = new LineSeries { Title = "Raleigh", LineLegendPosition = LineLegendPosition.End, TrackerFormatString = TrackerFormatString };
var minneapolis = new LineSeries { Title = "Minneapolis", LineLegendPosition = LineLegendPosition.End, TrackerFormatString = TrackerFormatString };
var phoenixTemps = new[] { 52.1, 55.1, 59.7, 67.7, 76.3, 84.6, 91.2, 89.1, 83.8, 72.2, 59.8, 52.5 };
var raleighTemps = new[] { 40.5, 42.2, 49.2, 59.5, 67.4, 74.4, 77.5, 76.5, 70.6, 60.2, 50.0, 41.2 };
var minneapolisTemps = new[] { 12.2, 16.5, 28.3, 45.1, 57.1, 66.9, 71.9, 70.2, 60.0, 50.0, 32.4, 18.6 };
for (int i = 0; i < 12; i++)
{
phoenix.Points.Add(new DataPoint(i, phoenixTemps[i]));
raleigh.Points.Add(new DataPoint(i, raleighTemps[i]));
minneapolis.Points.Add(new DataPoint(i, minneapolisTemps[i]));
}
model.Series.Add(phoenix);
model.Series.Add(raleigh);
model.Series.Add(minneapolis);
var categoryAxis = new CategoryAxis
{
AxislineStyle = LineStyle.Solid
};
categoryAxis.Labels.AddRange(new[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" });
model.Axes.Add(categoryAxis);
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Title = "Fahrenheit", AxislineStyle = LineStyle.Solid });
return model;
}
开发者ID:Celderon,项目名称:oxyplot,代码行数:35,代码来源:ShowCases.cs
示例14: CreateLineSeries
private static LineSeries CreateLineSeries(CalculationViewModel newViewModel)
{
var newSeries = new LineSeries
{
DataContext = newViewModel,
DependentValuePath = "Value",
IndependentValuePath = "Date"
};
BindingOperations.SetBinding(newSeries, Series.TitleProperty, new Binding("Title"));
var filter = new CollectionSizeFilter();
BindingOperations.SetBinding(filter,
CollectionSizeFilter.MaxItemCountProperty,
new Binding("ActualWidth")
{
RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(Chart), 1),
Converter = new DivisionConverter(),
ConverterParameter = 25
}
);
BindingOperations.SetBinding(filter,
CollectionViewSource.SourceProperty,
new Binding("ResultOverTime"));
newSeries.Resources.Add("FilteredBalances", filter);
BindingOperations.SetBinding(newSeries,
DataPointSeries.ItemsSourceProperty,
new Binding { Source = filter });
return newSeries;
}
开发者ID:LeeCampbell,项目名称:ArtemisWest-Mayfair,代码行数:30,代码来源:ChartSeriesSyncBehavior.cs
示例15: MouseDownEventHitTestResult
public static PlotModel MouseDownEventHitTestResult()
{
var model = new PlotModel { Title = "MouseDown HitTestResult", Subtitle = "Reports the index of the nearest point." };
var s1 = new LineSeries();
s1.Points.Add(new DataPoint(0, 10));
s1.Points.Add(new DataPoint(10, 40));
s1.Points.Add(new DataPoint(40, 20));
s1.Points.Add(new DataPoint(60, 30));
model.Series.Add(s1);
s1.MouseDown += (s, e) =>
{
model.Subtitle = "Index of nearest point in LineSeries: " + Math.Round(e.HitTestResult.Index);
model.InvalidatePlot(false);
};
var s2 = new ScatterSeries();
s2.Points.Add(new ScatterPoint(0, 15));
s2.Points.Add(new ScatterPoint(10, 45));
s2.Points.Add(new ScatterPoint(40, 25));
s2.Points.Add(new ScatterPoint(60, 35));
model.Series.Add(s2);
s2.MouseDown += (s, e) =>
{
model.Subtitle = "Index of nearest point in ScatterSeries: " + (int)e.HitTestResult.Index;
model.InvalidatePlot(false);
};
return model;
}
开发者ID:Celderon,项目名称:oxyplot,代码行数:30,代码来源:MouseEventExamples.cs
示例16: WpfConstruct
public static Chart WpfConstruct(Signal signal)
{
Chart chart = new Chart();
LineSeries series = new LineSeries();
series.DependentValuePath = "Value";
series.IndependentValuePath = "Key";
KeyValuePair<double, double>[] points = new KeyValuePair<double, double>[signal.T.Length];
for (int i = 0; i < signal.T.Length; ++i)
points[i] = new KeyValuePair<double, double>(signal.T[i], signal.X[i]);
series.ItemsSource = points;
chart.Height = 300;
//Axis t = new LinearAxis();
//t.Name = "Time";
//Axis v = new LinearAxis();
//v.Name = "Value";
//chart.Axes.Add(t);
//chart.Axes.Add(v);
chart.Series.Add(series);
return chart;
}
开发者ID:kverhun,项目名称:SignalProcessor,代码行数:25,代码来源:WpfChartConstructor.cs
示例17: GraphSalesRank
public GraphSalesRank()
{
model = new PlotModel();
model.Title = "SalesRank";
DateTimeAxis axisX = new DateTimeAxis();
axisX.Position = AxisPosition.Bottom;
axisX.Title = "Date";
model.Axes.Add(axisX);
LinearAxis axisY = new LinearAxis();
axisY.Position = AxisPosition.Left;
axisY.Minimum = 0;
axisY.Title = "SalesRank";
model.Axes.Add(axisY);
series = new LineSeries();
series.Title = string.Format("ASIN: {0}", this.Asin);
this.Asin = "0061670898";
model.Series.Add(series);
InitializeComponent();
oxyPlotView.Model = model;
}
开发者ID:mjnichols,项目名称:Cheapees,代码行数:27,代码来源:GraphSalesRank.xaml.cs
示例18: ShowNearestSelectedPointCommands
protected override void ShowNearestSelectedPointCommands(AppIdentity identity, LineSeries lineSeries, OxyMouseDownEventArgs args)
{
GuiModelData.SelectedApplicationIdentity = identity;
var requestId = getSelectedRequestId(args.HitTestResult.Index, lineSeries);
showCommands(requestId);
setSelectedPointInfo(lineSeries, args);
}
开发者ID:yao-yi,项目名称:DNTProfiler,代码行数:7,代码来源:MainViewModel.cs
示例19: getSelectedRequestId
private static int getSelectedRequestId(double index, LineSeries lineSeries)
{
var indexOfNearestPoint = (int)Math.Round(index);
var point = lineSeries.Points[indexOfNearestPoint];
var requestId = (int)point.X;
return requestId;
}
开发者ID:yao-yi,项目名称:DNTProfiler,代码行数:7,代码来源:MainViewModel.cs
示例20: Window1
public Window1()
{
InitializeComponent();
wfd = new WFDLakesViewModel();
tabControl1.DataContext = wfd;
tabControl1.SelectionChanged += new SelectionChangedEventHandler(tabControl1_SelectionChanged);
LineSeries LS = new LineSeries();
LS.ItemsSource = wfd.Precipitation.Items;
LS.DependentValuePath = "Value";
LS.IndependentValuePath = "EndTime";
LS.Title = wfd.Precipitation.Name;
this.EvapPrecip.Series.Add(LS);
LineSeries LS2 = new LineSeries();
LS2.ItemsSource = wfd.Evaporation.Items;
LS2.DependentValuePath = "Value";
LS2.IndependentValuePath = "EndTime";
LS2.Title = wfd.Evaporation.Name;
this.EvapPrecip.Series.Add(LS2);
Datagrid1.SelectionMode = Microsoft.Windows.Controls.DataGridSelectionMode.Single;
Datagrid1.SelectionChanged += new SelectionChangedEventHandler(Datagrid1_SelectionChanged);
}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:28,代码来源:Window1.xaml.cs
注:本文中的LineSeries类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论