Mistake in documentation
TonHadry wrote at 2014-02-14 13:38:
http://www.oxyplot.org/doc/HelloWpf.html
There is same code for "Create view model" and for "Create View"...
objo wrote at 2014-02-14 15:56:
Plot Location/Size issue
imaloop wrote at 2013-11-23 16:29:
I seem to have an issue fixing the location and size of the Plot. is this normal or al i missing something?
My code is like this:
GPlot.Model = new PlotModel();
GPlot.Dock = DockStyle.Fill;
GPlot.Enabled = true;
GPlot.Parent = Top_Tabs.TabPages[2]; // Putting it on a Tab
// At this point the Location And Size of GPlot, are those of the containing parent
GPlot.Location = new System.Drawing.Point(279, 224);
GPlot.Size = new System.Drawing.Size(10, 10);
// Last Two lines had no effect.
this.Matlab.Controls.Add(GPlot);
thank youimaloop wrote at 2013-11-23 16:39:
Plot Model not rising INotifyPropertyChanged event
eZegpi wrote at 2013-09-30 15:07:
Here is the relevant xml
xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
<oxy:Plot Model="{Binding PlotData}" Margin="466,67,123,199"></oxy:Plot>
and the associated code to update PlotDataprivate PlotModel PlotData = new PlotModel();
var temp = new PlotModel("Inter");
var al1 = new OxyPlot.Series.LineSeries("Inter");
for (int i = 0; i < Curve.GetLength(0); i++)
{
al1.Points.Add(new DataPoint(Curve[i, 1], Curve[i, 2]));
}
temp.Series.Add(al1);
temp.Axes.Add(new OxyPlot.Axes.LinearAxis(OxyPlot.Axes.AxisPosition.Bottom, 0, maxX, "X Axis"));
temp.Axes.Add(new OxyPlot.Axes.LinearAxis(OxyPlot.Axes.AxisPosition.Left, Min, Max, "Y Axis"));
PlotData = temp;
I suspected that PlotData was not updating correctly, but if I doConsole.WriteLine(PlotData.ToString());
it correctly prints "Inter", if I call that same instruction before the assignment it prints a null line.
Can anyone help me to find my mistake?
Thanks a lot
everytimer wrote at 2013-09-30 17:44:
eZegpi wrote at 2013-09-30 22:53:
<oxy:Plot Model="{Binding Source={StaticResource viewModel}, Path=PlotData}" Margin="466,67,123,199"></oxy:Plot>
I got it to work. Thank you very much!!
Trouble getting plot to refresh
willmoore88 wrote at 2013-07-11 10:43:
<Grid Style="{StaticResource ContentRoot}">
<oxy:Plot x:Name="CloudLayerPlot" Model="{Binding CloudLayerPlotModel}" Width="600" Margin="0,0,0,0" />
</Grid>
Some of the code behind this XAML page. public PlotModel CloudLayerPlotModel { get; set; }
public cloudDetectionGraph()
{
InitializeComponent();
DataContext = this;
}
I then call this code: makeCloudLayerPlotModel();
private void makeCloudLayerPlotModel()
{
var end = new DateTime();
end = DateTime.Now;
var start = new DateTime();
start = end.AddDays(-1);
// Create data collection
var data = new Collection<DateValue>();
var date = start;
// Other code here - removed as it's quite long
plotModel1.Series.Add(lineSeries1);
plotModel1.Series.Add(lineSeries2);
plotModel1.Series.Add(lineSeries3);
plotModel1.Series.Add(lineSeries4);
CloudLayerPlotModel = plotModel1;
CloudLayerPlotModel.RefreshPlot(true);
}
I've tried using RefreshPlot() in different places, ie. after when I call my function to make the plotmodel. I've also tried using invalidateplot() but no joy there either. Sure it's something i'm just overlooking!
When I call this function the first time, the plot is drawn correctly, subsequent calls don't though.
raphay wrote at 2013-07-11 14:06:
YourClass : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
PlotModel cloudLayerPlotModel;
public PlotModel CloudLayerPlotModel {
get{ return cloudPlotModel ; }
set
{
cloudPlotModel = value;
OnPropertyChanged("CloudLayerPlotModel");
}
}
protected void OnPropertyChanged(string name)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(name));
}
}
}
I hope this will resolve your problemwillmoore88 wrote at 2013-07-11 14:45:
Magnitude axis of a polar plot with labels
aec wrote at 2012-08-28 22:57:
Hi objo. Is it possible to have a magnitude axis of a polar plot with labels?
objo wrote at 2012-08-29 06:41:
I don't think that was implemented yet, but the MagnitudeAxis should support drawing the tick labels.
I guess you need some control on the placement of the labels?
aec wrote at 2012-08-29 21:06:
No, not really. It was only a question for reasons of consistency because every axis type has labels except the magnitude axis.
SAlexander wrote at 2013-10-10 23:22:
Labels are really required on scientific graph.
Magnitude values are not always normalized, It is strange not to be able to read value from the graph.
Or I am wrong and numerical labels can be shown? I have spent a lot of time trying to locate them.
If linear and polar axis can be shown at the same time, that will work.
(Similar problem in this post https://oxyplot.codeplex.com/discussions/434932)
objo wrote at 2013-10-11 08:17:
Slow loading graphs using WPF
willmoore88 wrote at 2013-08-13 10:30:
I am plotting 1-4 scatter series onto a time / linear graph. The ItemsSource is set to a collection of DateValues - pretty much a copy of whats in one of the examples.
Any ideas why I'm experiencing this slow down?
everytimer wrote at 2013-08-13 20:07:
willmoore88 wrote at 2013-08-14 09:02:
var lineSeries1 = new LineSeries("Cloud 1")
{
Color = OxyColors.Transparent,
MarkerFill = OxyColors.Black,
MarkerStroke = OxyColors.Black,
MarkerType = MarkerType.Circle,
MarkerSize = 1.5,
StrokeThickness = 1,
DataFieldX = "Date",
DataFieldY = "Value1",
ItemsSource = data
};
var lineSeries2 = new LineSeries("Cloud 2")
{
Color = OxyColors.Transparent,
MarkerFill = OxyColors.Black,
MarkerStroke = OxyColors.Black,
MarkerType = MarkerType.Circle,
MarkerSize = 1.5,
StrokeThickness = 1,
DataFieldX = "Date",
DataFieldY = "Value2",
ItemsSource = data
};
var lineSeries3 = new LineSeries("Cloud 3")
{
Color = OxyColors.Transparent,
MarkerFill = OxyColors.Black,
MarkerStroke = OxyColors.Black,
MarkerType = MarkerType.Circle,
MarkerSize = 1.5,
StrokeThickness = 1,
DataFieldX = "Date",
DataFieldY = "Value3",
ItemsSource = data
};
var lineSeries4 = new LineSeries("Cloud 4")
{
Color = OxyColors.Transparent,
MarkerFill = OxyColors.Black,
MarkerStroke = OxyColors.Black,
MarkerType = MarkerType.Circle,
MarkerSize = 1.5,
StrokeThickness = 1,
DataFieldX = "Date",
DataFieldY = "Value4",
ItemsSource = data
};
var lineSeries5 = new LineSeries("Vertical Visibility")
{
Color = OxyColors.Transparent,
MarkerFill = OxyColors.Transparent,
MarkerStroke = OxyColors.Blue,
MarkerType = MarkerType.Square,
MarkerSize = 1.5,
StrokeThickness = 1,
DataFieldX = "Date",
DataFieldY = "Value5",
ItemsSource = data
};
Mainly circles, with only the occasional square. I'll give cross a go but I really need circles!Question about accessing the plot in MVVM
DrStrangeLove wrote at 2014-03-15 04:16:
Any help is greatly appreciated and I hope I explained this question thoroughly.
DrStrangeLove wrote at 2014-03-26 17:56:
tibel wrote at 2014-03-26 19:21:
objo wrote at 2014-03-26 20:25:
Plot
control has an InvalidatePlot
method that can be called to invalidate and update the data.
There is also a command binding on the
Plot.ResetAxesCommand
command (I think this should be refactored to
PlotCommands.ResetAxes
) You can also bind to the
InvalidateFlag
property - when the value is changed the plot is invalidated. I am not sure if this is a good feature, would like to get feedback on this one..
I think it is possible to use an attached property if you want to bind to the actual
PlotModel
.objo wrote at 2014-03-26 20:35:
PlotCommands.ResetAxes
. See example in the "ExportDemo".DrStrangeLove wrote at 2014-03-27 15:06:
Report text color
everytimer wrote at 2013-08-15 11:34:
I've tried to convert HeaderStyles to a list instead of an array but that gave me a lot of troubles and finally a rare exception occurred. After that I just tried to increase HeaderStyles array to 25 (I will need 20 different colors + let intact the 5 default header style).
The problem is that if I set the array bigger than 9 a null reference exception occurs. I wonder if there is a better way of implementing this requirement and if not what can I do for being able to increase the array size of HeaderStyles to 25.
inside a loop:
ParagraphStyle myStyle = new ParagraphStyle { BasedOn = reportStyle.DefaultStyle };
reportStyle.HeaderStyles[4 + myStyleSelector ] = myStyle ;
report.AddHeader(5 + myStyleSelector , "my text");
after: using (var w = new PdfReportWriter((dlg.FileName)))
{
w.WriteReport(report, reportStyle);
}
objo wrote at 2013-08-15 17:05:
To change the color on parts of a paragraph, we need to implement Inline elements with a Style property. I have added an issue:
https://oxyplot.codeplex.com/workitem/10071
Check if point was selected
Xgamer wrote at 2012-05-06 15:17:
Hello,
I would like to ask how can I check if point from series was selected?Is it possible to somehow check if default point mousehover event was invoked?
I am newbie in using oxyplot library :)
objo wrote at 2012-05-07 18:05:
The mouse events that was just added contains a "HitTestResult" in the event arguments.
The hit test results contains a property "Index" which should give you the index of the point that was clicked on. Note that the index is of type double; if the index = 4.5 it means that the user clicked on the line half-way between point 4 and 5 (in the case of a LineSeries). You have to decide if it is close enough, and then use Math.Round(Index) to get the index of the nearest point.
Note that selection is not completely implemented yet.
viklele wrote at 2012-10-12 10:35:
I know my reply is a bit late, but here is a code fragment for anyone to use:
// Subscribe to the event plot.Model.MouseDown += new EventHandler<OxyPlot.OxyMouseEventArgs>(plotModel_MouseDown); // event handler void plotModel_MouseDown(object sender, OxyPlot.OxyMouseEventArgs e) { Plot plot = sender as Plot; switch (e.ChangedButton) { case OxyPlot.OxyMouseButton.Left: OxyPlot.Series series = plot.GetSeriesFromPoint(e.Position, 10); if (series != null) { OxyPlot.TrackerHitResult result = series.GetNearestPoint(e.Position, true); if (result != null && result.DataPoint != null) { // data point nearest to the click OxyPlot.IDataPoint dataPoint = result.DataPoint; } } break; } }
LogarithmicAxis does not raise AxisChanged Event when zooming
WeirdNoise wrote at 2013-08-13 20:38:
I think you would need to add a RaiseAxisChanged-Method in the base Axis Class to allow the child class to raise the event?
WeirdNoise wrote at 2013-08-13 21:05:
Public Class LogAxis
Inherits Axes.LogarithmicAxis
Public Event ActualAxisChanged(min As Double, max As Double)
Public Overrides Sub ZoomAt(factor As Double, x As Double)
MyBase.ZoomAt(factor, x)
RaiseEvent ActualAxisChanged(ViewMinimum, ViewMaximum)
End Sub
Private Sub Axis_Changed() Handles MyBase.AxisChanged
RaiseEvent ActualAxisChanged(ViewMinimum, ViewMaximum)
End Sub
End Class
objo wrote at 2013-08-14 07:02:
objo wrote at 2013-08-14 07:04:
UpdateActualMaxMin();
method is called - you should use
ActualMaximum
and ActualMinimum
to get the actual limits.WeirdNoise wrote at 2013-08-14 08:16:
Customer support service by UserEcho