Import Txt file to OxyPlot
loreleon wrote at 2014-02-06 20:06:
I'm new at this.
I have one txt file, this was export from GnuPlot. This contains the (X,Y) points, I want import this file to Oxyplot. Someone knows how to do it?
Thank you so much!!
everytimer wrote at 2014-02-06 23:24:
Oxyplot accepts lists of DataPoint, so it is your job to read the file and store the data in your arrays/lists.
There are plenty of examples plotting data, and several of them read an external file.
Good luck
Axis displayed min and max tick labels
Slxe wrote at 2014-07-09 20:53:
As a shitty example, here's a picture altered in paint, red and purple ticks and labels being two different ideas for where to show the visible min and maxes.
objo wrote at 2014-07-10 12:26:
If the most extreme value should be used, should it take the maximum/minimum of all series using that axis? What about the formatting - should it use the same formatting string as for the other labels, or have its own formatting string?
I have added https://oxyplot.codeplex.com/workitem/10229
Slxe wrote at 2014-07-10 15:59:
Double Line Series Plot with 2 Y axes
bball0246 wrote at 2013-02-18 17:47:
ivarstange wrote at 2013-02-19 10:16:
var pm = new PlotModel();
var secondaryAxis = new LinearAxis(AxisPosition.Left, "Secondary"); // And add other axes as well
pm.Axes.Add(secondaryAxis); // Add them all
var ls = new LineSeries("Secondary Line");
// Do stuff to add datapoints here
secondaryAxis.Key = "Secondary";
ls.YAxisKey = "Secondary";
Edit: Typoivarstange wrote at 2013-02-19 10:43:
bball0246 wrote at 2013-02-19 20:46:
bball0246 wrote at 2013-02-19 21:14:
secondaryAxis.TicklineColor = OxyColors.Red;
secondaryAxis.TitleColor = OxyColors.Red;
secondaryAxis.TextColor = OxyColors.Red;
ls.Color = OxyColors.Red;
Still working on the zoom/pan issue.bball0246 wrote at 2013-02-19 21:28:
ivarstange wrote at 2013-02-19 21:39:
urm3l wrote at 2013-04-03 23:59:
You can work around the issue of the independent axes with following the example of the coupled axes, But instead of using the actualMaximum of the other axis you are computing a proportion factor with the two maxima of your plots. Then you can scale the actualMaximum with that factor.
Its a little trickier to do that for the mimima as well but it should work.
Graph autoadjust disable.
If I add one scatterpoint using:
scatterSeries1.Points.Add(new ScatterPoint( x, y));
and then:
plotView1.InvalidatePlot(true);
the graph is autoadjusted to see the plot. Thanks in advance
Heatmap support
AlexeiShcherbakov wrote at 2012-11-15 13:04:
- Is it planned?
- If no, how to implement it correctly
objo wrote at 2012-11-15 19:51:
yes, it is http://oxyplot.codeplex.com/workitem/9985 and http://oxyplot.codeplex.com/workitem/9801
sorry, I have not looked into how to implement it yet. Would like to render using bitmaps for performance...
Disable Zooming and Panning In Xamarin Forms
I am doing my application with real time plot view. The problem is that when i touch to the plot area (Panning or Zooming), the plot view stop updating. There fore i would like to ask if someone know how to disable zooming or panning or Is there any other methods to fix my problem.
Thank you very much in advance
Does OxyPlot work in .NET 3.5?
guilhermecgs wrote at 2013-10-11 19:14:
I couldn't find it in http://oxyplot.codeplex.com/, but maybe there is an old version...
objo wrote at 2013-10-15 15:09:
The core is PCL, and this is not supported by 3.5 (http://msdn.microsoft.com/en-us/library/gg597391.aspx).
You need to build the core for .NET 3.5 yourself.
The WPF, Winforms, pdf etc. libraries should also be possible to compile for 3.5.
ryoujr wrote at 2013-10-15 21:17:
I was also looking for any solution for .NET 3.5. So, could you please elaborate more on this how I can make my own libraries for .NET 3.5 (how to build the core for .NET 3.5 and so on)? I'm new to PCL stuff.
Thank you very much.
andygough1974 wrote at 2013-10-16 19:57:
Can you clarify what you mean by "core" please?
Many thanks
ryoujr wrote at 2013-10-18 00:14:
Based on your comment which said it should be possible to build oxyplot libraries for .NET 3.5, I started working on this.
I'm using 3 libraries (OxyPlot, OxyPlot.Wpf, OxyPlot.Xps) and I just made a new project with "Class Library" option for a OxyPlot and added all required files to the project to remove PCL stuff. (Seems you mentioned this to Core)
Now, it seems okay for this OxyPlot, but when I try to build WPF and XPS libraries by changing .net version to 3.5, it showed several errors which include "ManipulationCompletedEventArgs not defined"
I found that this was also supported from .NET 4.0, and others also looked something like this.
So, I would appreciate it if you could elaborate more on this procedure to make it working on .NET 3.5, and if I was doing something wrong, I hope you can correct me.
Thank you.
guilhermecgs wrote at 2013-10-18 00:32:
I am no expert at Oxyplot, but as a developer I wouldn't try to change the source code to make it compatible to .NET 3.5.
- It will probably need tons of time to make it work, (if it work)
- There's going to be several bugs
- You will be by your on
- There is several other options, such as DynamicDataDisplay
Also, if you want to contribute to the community, make sure your improvement or functionality is needed by other people. I suggested you contact the main developers of this project and try to include this feature in the product roadmap.
objo wrote at 2013-10-19 09:26:
The WPF touch event handlers are moved into a partial class that is not compiled in the NET 3.5 project.
I am not adding the NET 3.5 solution into the build for NuGet, you need to build OxyPlot yourself if you want to use it with this version of the .NET framework.
ryoujr wrote at 2013-10-19 17:25:
So, if I understand correctly, maybe I should update to the latest build, then I can build my own NET 3.5 libraries without above issues.
Metro style app-display problem
Leilunte wrote at 2012-10-24 09:54:
Hi, objo
I am following the metro example of BasicSample step by step.
And, I pass the debug.
However, I can't see anything on my window 8.
Is it any way to solve it?
Thanks.
taschmidt wrote at 2012-10-27 16:06:
I'm having the same problem. Anyone find a solution yet?
objo wrote at 2012-10-27 19:08:
Could it be a missing Generic.xaml? (as in http://oxyplot.codeplex.com/workitem/10008)
Possible workaround: try to include OxyPlot and OxyPlot.Metro in your solution, and reference the projects instead of the assemblies.
Hope we find a solution to this soon!
taschmidt wrote at 2012-10-28 04:20:
Yep, grabbing the source and setting a project reference worked. I'm assuming this is a temporary thing?
Thanks!
objo wrote at 2012-10-28 08:25:
This should now be corrected. Try the latest NuGet package.
taschmidt wrote at 2012-10-28 17:04:
The latest NuGet package fixed it! Thanks a lot for the fast turnaround!
Plotting time-series data (Speech and Other events)
vermahimanshu7 wrote at 2014-04-14 15:50:
I have to generate time-series graphs where I can show speech (not as fancy speech waveforms) for different users. In addition, I would like to overlay other important discrete events on the speech. Is this possible to do in OxyPlot?
Maybe the question that I asked sounds a bit stupid, but I have to quickly decide on an effective API for generating charts where I am free to add multiple streams of data and can play around with the customization of the charts. I am quite proficient in WPF and C#.
Thanks in advance and any help would be greatly appreciated :)
Memoryleak in the heatmap?
EydenJones wrote at 2013-04-05 09:50:
I've used oxyplot (which is great); but I have a memory leak while using the heatmap in wpf.
Every couple of seconds, I update the data of the heatmap like so:
heatMapSeries.Data = dataValues;
- refresh plotmodel
Kind regards
EydenJones wrote at 2013-04-05 10:09:
I tried overriding the Render method, call the base and then call the cleanup method myself, but it throws an collection modified exception. Sadly :)
I've looked in the sourcecode
// Find the images in the cache that has not been used since last call to this method
var imagesToRelease = this.imageCache.Keys.Where(i => !this.imagesInUse.Contains(i));
// Remove the images from the cache
foreach (var i in imagesToRelease)
{
this.imageCache.Remove(i);
}
this.imagesInUse.Clear();
There may be a bug in here. I would call the ToList() at the end of the first line.Kind regards
objo wrote at 2013-04-18 09:54:
I added the issue: https://oxyplot.codeplex.com/workitem/10042
NejibCh wrote at 2013-04-23 21:30:
I am using WPF, Visual Studio 2012, C#, .Net4.0
Kind Regards
objo wrote at 2013-04-24 11:12:
Examples/Wpf/WpfExample
application later. Can you propose an interesting example? It is more fun showing some real data than dummy values :)ManhoiHur wrote at 2013-04-26 05:21:
EydenJones wrote at 2013-04-26 09:29:
https://oxyplot.codeplex.com/SourceControl/changeset/view/57c03876808d#Source/Examples/ExampleLibrary/Examples/HeatMapSeriesExamples.cs
NejibCh wrote at 2013-04-27 05:49:
I had many challenges to set the contours, contour labels and colorAxis position (Needed to add a transparent axis to push the ColorAxis further for plotArea)
By the way this is great tool. Much better than some marketed tools "like Infragistics for example).
Good job guys.
!!!!!!!!!!!!!!!!!!!!!!!!!!! ----------------------- in the XAML
<Window x:Class="TreeMapInfragistics.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
xmlns:oxy2="clr-namespace:OxyPlot.Series;assembly=OxyPlot"
Title="MainWindow" Height="610" Width="610">
<Grid>
<oxy:Plot x:Name="MyOxyPlot" Model="{Binding MyPlotModelTab3}"/>
</Grid>
</Window> !!!!!!!!!!!!!!!!!!!!!!!!!!! ----------------------- in the ViewModel
using System;
using System.Linq;
using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Series;
namespace HeatMapWithContours
{
public class MainViewModel: BaseViewModel
{
public double [] mnMxXY = new double[6];
public double[] WOB;
public double[] RPM;
public MainViewModel()
{
UpdateChart();
}
// ..........................................
private PlotModel _myPlotModelTab3;
public PlotModel MyPlotModelTab3
{
get { return _myPlotModelTab3; }
set
{
_myPlotModelTab3 = value;
OnPropertyChanged("MyPlotModelTab3");
}
}
public void UpdateChart()
{
double[,] MyData = GenerateData();
#region HeatMapSeries
var hm = new HeatMapSeries();
hm.Data = MyData;
hm.Selectable = false;
hm.X0 = mnMxXY[0]; // Min X-axis
hm.X1 = mnMxXY[1]; // Max X-axis
hm.Y0 = mnMxXY[2]; // Min Y-axis
hm.Y1 = mnMxXY[3]; // Max Y-axis
#endregion
#region ContourSeries
var cs = new ContourSeries()
{
// ..............
ColumnCoordinates = WOB, //yvalues
RowCoordinates = RPM,//xvalues
Data = MyData,
// ............
ContourLevelStep = 5,
StrokeThickness = 0.5,
LineStyle = LineStyle.Solid,
Color = OxyColors.Gray,
//ContourColors = new[] { OxyColors.SeaGreen, OxyColors.RoyalBlue, OxyColors.IndianRed },
// ...............
LabelFormatString = "[0.00]",
LabelBackground = null,
//LabelSpacing = double.NaN,
//Font = null,
//LabelStep = 10,
FontSize = 11,
FontWeight = FontWeights.Normal,
TextColor = OxyColors.Black
//Background = OxyColor.FromAColor(220, OxyColors.White),
//TrackerFormatString = null,
};
#endregion
#region X- Axis
LinearAxis xAxis = new LinearAxis
{
Position = AxisPosition.Bottom,
Title = "RPM",
ClipTitle = true,
TitlePosition = 0.5,
MinorGridlineStyle = LineStyle.Dot,
MajorGridlineStyle = LineStyle.Dot,
MinorGridlineThickness = 1,
MajorGridlineThickness = 1,
IsAxisVisible = true,
IsZoomEnabled = false,
IsPanEnabled = false,
Angle = 0,
AxisTitleDistance = 4,
AxisTickToLabelDistance = 4,
MajorTickSize = 7,
MinorTickSize = 4,
Minimum = mnMxXY[0],
Maximum = mnMxXY[1],
ShowMinorTicks = true
};
#endregion
#region Y- Axis
LinearAxis yAxis = new LinearAxis
{
Position = AxisPosition.Left,
Title = "WOB",
ClipTitle = true,
TitlePosition = 0.5,
MinorGridlineStyle = LineStyle.Dot,
MajorGridlineStyle = LineStyle.Dot,
MinorGridlineThickness = 1,
MajorGridlineThickness = 1,
IsAxisVisible = true,
IsZoomEnabled = false,
IsPanEnabled = false,
Angle = 0,
AxisTitleDistance = 4,
AxisTickToLabelDistance = 4,
MajorTickSize = 7,
MinorTickSize = 4,
Minimum = mnMxXY[2],
Maximum = mnMxXY[3],
ShowMinorTicks = true
};
#endregion
#region Y1- Axis
LinearAxis y2Axis = new LinearAxis
{
Position = AxisPosition.Right,
IsAxisVisible = true,
IsZoomEnabled = false,
IsPanEnabled = false,
TicklineColor = OxyColors.Transparent,
AxislineColor = OxyColors.Transparent,
TextColor = OxyColors.Transparent
};
#endregion
#region ColorAxis
ColorAxis cAxis = new ColorAxis
{
Position = AxisPosition.Right,
PositionTier = 1,
Palette = OxyPalettes.Jet(500),
HighColor = OxyColors.Red,
LowColor = OxyColors.Blue,
Minimum = mnMxXY[4],
Maximum = mnMxXY[5],
StartPosition = 0.05,
EndPosition = 0.95,
IsAxisVisible = true,
Angle = 0,
AxisTitleDistance = 4,
AxisTickToLabelDistance = 4,
MajorTickSize = 7,
MinorTickSize = 4,
ShowMinorTicks = true,
UseSuperExponentialFormat = true
};
#endregion
#region PlotModel
PlotModel tempPlotModel = new PlotModel();
tempPlotModel.AutoAdjustPlotMargins = true;
tempPlotModel.PlotAreaBackground = OxyColors.Red;
tempPlotModel.Title = "Critical Speed Map (XPos)";
tempPlotModel.TitleFontWeight = FontWeights.Normal;
tempPlotModel.PlotAreaBorderThickness = 1;
tempPlotModel.PlotAreaBorderColor = OxyColors.Black;
tempPlotModel.Axes.Add(xAxis);
tempPlotModel.Axes.Add(yAxis);
tempPlotModel.Axes.Add(y2Axis);
tempPlotModel.Axes.Add(cAxis);
tempPlotModel.Series.Add(hm);
tempPlotModel.Series.Add(cs);
#endregion
MyPlotModelTab3 = tempPlotModel;
}
#region Generate Data
private double[,] GenerateData()
{
..........
}
} }
objo wrote at 2013-04-29 13:23:
This bug is high priority (I don't want memory leaks in this library), but it is possible I need some time to solve this...
guevara123 wrote at 2013-05-22 11:18:
I.e.: A huge spectrum of values needs way more rendering, than a small spectrum of values.
Could you provide what kind of data is used?
willmoore88 wrote at 2013-08-28 15:22:
Any news on a fix for this? Or a pointer on where to look in the code and i'll give it a go myself.
objo wrote at 2013-08-28 15:40:
CleanUp()
method in ShapesRenderContext
. It seems I have forgot to call it...objo wrote at 2013-08-28 15:48:
yetangye wrote at 2013-09-04 12:33:
I have submitted a fix, let us know if this solves the problem!Yes, you fixed it! Thank U very much!
I tested the new version with a huge ImageAnnotation, and the program's memory leak disappeared.
Служба підтримки клієнтів працює на UserEcho