Contour Axis Min/Max
Schnitzos wrote at 2013-10-02 16:36:
First of all - oxyPlot is really cool - many thanks to objo (and other contributers)!
I have a problem with ContourSeries, it looks as if the X axis is scaled to the Y extent of the contour and vice versa (not easy to see in the example because the axis extent is almost the same). Could it be that in UpdateMaxMin() in ContourSeries Column- and Rowcoordinates are switched?
Thanks!
Schnitzos
objo wrote at 2013-10-03 19:46:
Possible bug with mouse event on WPF chart [RESOLVED]
raphay wrote at 2013-06-13 11:06:
I am creating an application with Oxyplot, which is great, but i recently faced with a problem : when i have my chart empty of rectangle annotation the mouse event doesn't trigger at all (i can't zoom or pan even with the middle button, except from the axes mouse over event). I resolved it by adding a white rectangle annotation, but it seems a bit ugly...
I may have done something bad, but i hope there is better fix to this problem.
Have a nice day...
raphay wrote at 2013-07-04 14:17:
<oxy:Plot Margin="0,0,4,0" Name="chart" Background="{x:Null}"/>
RegardsRectangular annotation and mouse events in WPF
ChevyCP wrote at 2012-10-19 19:27:
Hi,
Great work, 2 quick questions:
1 - Would it be possible to create the code to use the rectangular annotations in wpf 4.0 xaml instead of just in the c# code?
2 - For mouse events on line annotations, can the functions be created in xaml or do those have to be done in code? (ie -MouseDown="LA_MouseDown")
Thanks!
objo wrote at 2012-10-21 21:53:
1. I checked in the missing annotation adapter classes. See WpfExamples / AnnotationDemo
2. No, I don't think this is possible to do in XAML. I have not the events in the WPF adapter classes. But you can subscribe to the event of the "InternalAnnotation" properties of the annotations.
ChevyCP wrote at 2012-10-23 15:14:
Awesome, thanks!
ChevyCP wrote at 2012-10-23 16:35:
Now, if I create a line annotation in xaml and I want to add mouse events for it, is that possible? It already has a mousedown/up/etc, but those are not the oxyplot events. I need to create the annotation in xaml since I am binding the text and 'X' property to a data class and I don't think I can use .setbinding. So, how can I attach oxyplot mouse events to an annotation created in xaml, or how can I create bindings in c and create the whole annotation in c?
Thanks!
ChevyCP wrote at 2012-10-23 17:23:
I should clarify that I can set bindings on OxyPlot.wpf.Annotations just not on OxyPlot.LineAnnotation items. And since I can't convert them, I can't add them to my xaml created plot. The last two lines of code fail and can't have .setbinding, so I'm at a loss as to add mouse events to a line annotation that has binded properties.
var la = new LineAnnotation { Type = LineAnnotationType.Vertical, X = 4 }; chartingOxyPlot.Annotations.Add(la); chartingOxyPlot.Annotations.Add((OxyPlot.Wpf.LineAnnotation)la);
ChevyCP wrote at 2012-10-23 19:56:
I should have dug around a bit more. The internalannotation property did the trick.
Printing in WPF with XPS/PrintVisual
bitmatic wrote at 2014-02-15 20:10:
I have made a UserControl containing the charts and a few other controls, and it looks perfectly well in the xaml designer.
When i try to print it via XPS and PrintVisual the charts do not show up on the print (the rest of the controls do).
Have any of you had any experience printing OxyPlot's from WPF, and how did you do it ??
objo wrote at 2014-02-16 14:34:
bitmatic wrote at 2014-03-15 12:28:
So. If you have a UserControl (mine is called DefaultPrintControl) with some OxyPlot's and some other stuff on them, you can print it like this:
private void ButtonPrint_OnClick(object sender, RoutedEventArgs e)
{
var dialog = new PrintDialog();
if (dialog.ShowDialog() != true)
{ return; }
var dpc = new DefaultPrintControl();
dpc.Measure(new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight));
dpc.Arrange(new Rect(new Point(0, 0), dpc.DesiredSize));
dpc.UpdateLayout();
dialog.PrintVisual(dpc, "some description of the print job");
}
GuruK wrote at 2014-07-07 16:39:
I also try to print graph as same way. But I couldn't it even if I call UpdateLayout().
When I create instance of user control on memory empty page is printed out.
But I throw showing visual object to PrintVisual() it's no problem.
Should I set any special configuration to user control(XAML/code behind)?
In my case, user control is very simple as following.
<UserControl
x:Class="Reports.TestView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:oxy="http://oxyplot.codeplex.com"
d:DesignHeight="800" d:DesignWidth="600"
>
<Grid>
<oxy:Plot>
<oxy:Plot.Axes>
<oxy:LinearAxis Position="Left" Minimum="0" Maximum="100"/>
<oxy:TimeSpanAxis Position="Bottom" Minimum="0" Maximum="86400" StringFormat="hh:mm"/>
</oxy:Plot.Axes>
<oxy:Plot.Series>
<oxy:LineSeries ItemsSource="{Binding Path=DataList}" DataFieldX="Time" DataFieldY="Value" Color="Red"/>
</oxy:Plot.Series>
</oxy:Plot>
</Grid>
</UserControl>
bitmatic wrote at 2014-07-08 10:38:
I downgraded to version "2014.1.231.1" and it works with that version, so they must have changed something in the underlying rendering code....
GuruK wrote at 2014-07-08 16:08:
When I try to use 2014.1.231.1 from NuGet it works fine.
I checked changing point roughly. Cause is probably in InvalidatePlot() (Plot.cs or PlotView.cs).
From following version of source code, it has not rendered if it's not receive Loaded event.
revision : 824 / change set : ffbabf441bcea4e2871c8c86fc56dbe910b3f87f [ffbabf441bce]
This modification is for performance issue.
So... I added uncool code as following it seems be working on latest version of OxyPlot.
"graph" is name of Plot object (<oxy:Plot x:Name="graph">)
dpc.Measure(new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight));
dpc.Arrange(new Rect(new Point(0, 0), dpc.DesiredSize));
dpc.graph.RaiseEvent(new System.Windows.RoutedEventArgs(OxyPlot.Wpf.PlotView.LoadedEvent));
dpc.UpdateLayout();
or dpc.Measure(new Size(dialog.PrintableAreaWidth, dialog.PrintableAreaHeight));
dpc.Arrange(new Rect(new Point(0, 0), dpc.DesiredSize));
dpc.graph.IsRendering = true;
dpc.graph.InvalidatePlot(true);
dpc.graph.IsRendering = false;
dpc.UpdateLayout();
Of course this is not correct way... But currently it may be only way. It should be modified or extended for our case.
bitmatic wrote at 2014-07-09 13:37:
objo wrote at 2014-07-10 13:17:
XpsExporter
in the OxyPlot.Xps package? Can this be used? Let us know if there are bugs!bitmatic wrote at 2014-07-10 13:52:
What I (and GuruK apparently) need is more complex prints with both OxyPlots and other controls, such as textboxes, images, etc... So we make a UserControl with all the stuff we need to print out, and print it with the above code.
This worked fine until the latest update of the OxyPlot rendering code :-(
OxyPlot is the only control i have come across that can not be printed properly with this method. This could be a bug in OxyPlot(?) When you call Measure, Arrange & UpdateLayout on a control it is supposed to render - OxyPlot doesn't.
objo wrote at 2014-07-10 14:03:
I have added https://oxyplot.codeplex.com/workitem/10231
Mouse events on CategoryAxis
ckoo wrote at 2012-07-16 01:57:
Looking at the CategoryAxis it would be nice to be able to click on the Label to find out the label name and range (start and end points.)
It looks like the Axis class need to inherit from UIPlotElement instead of PlotElement? Is this correct and do you have any hints?
objo wrote at 2012-08-08 23:24:
Yes, the mouse events have not been implemented on the Axis classes yet. It should be covered by issue http://oxyplot.codeplex.com/workitem/9798 - so I have not closed this issue yet. There is some refactoring (due to issue http://oxyplot.codeplex.com/workitem/9595) to be done first, then it should be easier to do the axis hit testing.
reports
a5r wrote at 2013-12-04 12:06:
objo wrote at 2013-12-04 20:18:
The html, tex and docx outputs work as intended (I just submitted a flushing fix for html output)
Pdf output works, but is really slow (generating a few pages takes minutes, this seems to be a problem in the latest version of MigraDoc, or maybe something is not correct configured).
Xps output works - but formatting is not correct.
So... I think there is some work left to do before this is really usable...
a5r wrote at 2013-12-05 09:05:
a5r wrote at 2013-12-05 13:01:
a5r wrote at 2013-12-05 13:37:
objo wrote at 2013-12-06 18:19:
a5r wrote at 2013-12-08 15:07:
sumsum wrote at 2014-05-12 08:33:
thanks
objo wrote at 2014-05-12 10:37:
Source\Examples\WPF\ExportDemo
Hi I have run into a problem with building the APP package for the Windows Store (Metro)
doctorj wrote at 2012-09-29 00:35:
Hi ,
Oxyplot works fine in my app when I run it in the development environment on vs2012.
I tried to package my app today for the windows store and ran into some problems.
I got an error message telling me the one of the components in my package needs VCLIBS version 11.0.50522.1 and that the version of VCLIBS I have installed on the machine is VCLIBS 11.0..... or not the same version needed to the component ( I assume a lower version)
I took vcblibs out of the references and tried to oxyplot in the development environment and it did not work , so I verified that it is oxyplot that needs vclibs to execute.
Can you help me? do I have to get an updated C++ library from Microsoft to package oxyplot for the Windows Store? which version of the C++ library does oxyplot use?
You help would be greatly appreciated , I what to package the app and submit it to the store as soon as I can.
Thanks Jerry
objo wrote at 2012-09-29 19:08:
see reply in other thread: http://oxyplot.codeplex.com/discussions/396478
Feature suggestion: flashing line
typingcat wrote at 2012-11-02 07:01:
Hello,
When there are many lines (something like 20 or 30 lines), it feels quite hard for the user to find out the line of series they selected. If the line has some method like this
LineSeries.Flash(int interval, int speed),
the user can quickly find out the line they want to see.
I just came up with flashing, but I think any other idea to make a line distinguishable has the same effect. For example, glowing, vibrating, drawing a big arrow to that line, etc.
objo wrote at 2012-11-04 22:17:
good idea :) But it gives me an association to the <blink> element :)
Since this library is targetting multiple platforms, I only want to depend on simple drawing capabilities and no animations. For LineSeries my plan is to use a thicker line with a different color behind the real line. It will increase the rendering time slightly, but no need to calculate new coordinates. Other types of series (e.g. AreaSeries) need other solutions - ideas welcome!
Implementation of selection is covered by http://oxyplot.codeplex.com/workitem/8193
typingcat wrote at 2012-11-08 01:40:
Hello.
Your support is of a level that I have never experienced with any other open-source freeware, or even commercial software. You are working very hard. Thank you for the prompt implementation.
Limiting the zoom and restarting the axes
everytimer wrote at 2013-06-22 12:15:
My second question is how could I limit the zoomable area in code? I can't set it statically in XAML or in the initialization of the plot because my data will change and I want to limit the size depending on the data. Do I need to check before every PlotRefresh(true) my just added Series most extreme values and then use that values or is there something that already does that?
Thank you.
DJDAS wrote at 2013-06-24 10:26:
for a project I had the same needs and I solved it by binding the AbsoluteMaximum and AbsoluteMinimum of the axes to a property which changes as per my needs (i.e. the date selected by the user) after this you can call ResetAxes in your code and the axes automatically zoom to your limits.
Hoping to be helpful!
Bye!
everytimer wrote at 2013-06-24 11:23:
private void AxReset()
{
MyModel.Axes[0].Reset();
MyModel.Axes[1].Reset();
}
But I wonder why I can't access that ResetAxes of yours! Maybe the version of OxyPlot? I'm using WPF but I only add
using OxyPlot;
using OxyPlot.Series;
using OxyPlot.Annotations;
using OxyPlot.Axes;
Because if I add OxyPlot.Wpf it interfere with others, very odd...DJDAS wrote at 2013-06-24 11:37:
foreach (var axis in Plot.Axes)
axis.InternalAxis.Reset();
Protobuf-net to serialize plot model
sharethl wrote at 2014-03-17 15:39:
It should be a nice tool that help on saving and reading plot
But here I got a "Common Language Runtime detected an invalid program." on line "Serializer.Serialize"
Anyone know the issue?
var PolygonAnnotationType = RuntimeTypeModel.Default.Add(typeof(PolygonAnnotation), false).Add("Points"); var IDataPointType = RuntimeTypeModel.Default.Add(typeof(IDataPoint), false).Add("X", "Y"); IDataPointType.AddSubType(100, typeof(DataPoint)); var poly = new PolygonAnnotation(); IList<IDataPoint> ps = new List<IDataPoint>() { new DataPoint(0, 0), new DataPoint(1, 0) }; poly.Points = ps; MemoryStream ms = new MemoryStream(); Serializer.Serialize<PolygonAnnotation>(ms, poly); string stringBase64 = Convert.ToBase64String(ms.GetBuffer(), 0, (int)ms.Length); byte[] byteAfter64 = Convert.FromBase64String(stringBase64); MemoryStream afterStream = new MemoryStream(byteAfter64); var newPlot = Serializer.Deserialize<PolygonAnnotation>(afterStream); Console.Write(stringBase64);
private static void Test1() { var poly = new NewPolygon() { Points = new List<IDataPoint>(){ new NewDataPoint(0,0),new NewDataPoint(1,1) } }; RuntimeTypeModel.Default.Add(typeof(NewPolygon), false).Add("Points"); RuntimeTypeModel.Default.Add(typeof(IDataPoint), false).Add("X","Y").AddSubType(100,typeof(NewDataPoint)); MemoryStream ms = new MemoryStream(); Serializer.Serialize<NewPolygon>(ms, poly); string stringBase64 = Convert.ToBase64String(ms.GetBuffer(), 0, (int)ms.Length); byte[] byteAfter64 = Convert.FromBase64String(stringBase64); MemoryStream afterStream = new MemoryStream(byteAfter64); var newpoly = Serializer.Deserialize<NewPolygon>(afterStream); Console.Write(stringBase64); } class NewDataPoint : IDataPoint { public double X { get; set; } public double Y { get; set; } public NewDataPoint() { } public NewDataPoint(double x, double y) { this.X = x; this.Y = y; } } class NewPolygon : TextualAnnotation { public IList<IDataPoint> Points { get; set; } }
objo wrote at 2014-03-19 08:31:
PlotModel
and related classes will continue to evolve...sharethl wrote at 2014-03-19 14:28:
Protobuf-net: the unofficial manual
Customer support service by UserEcho