本文整理汇总了C#中LineSeries类的典型用法代码示例。如果您正苦于以下问题:C# LineSeries类的具体用法?C# LineSeries怎么用?C# LineSeries使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LineSeries类属于命名空间,在下文中一共展示了LineSeries类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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();
}
示例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);
}
示例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,
};
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}