This is the discussion forum for OxyPlot.
For bugs and new features, use the issue tracker located at GitHub.
Also try the chat room!

Strange behavior of XAML polar demo

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

aec wrote at 2012-08-28 22:49:

Hi, objo. In your WPF/XAML examples the polar demo (Defined in XAML) behaves strange. If you click with the right mouse onto the plot and move the mouse the plot is rotated. Fine. But there is also a change with respect to the magnitude axis. I think that this is a bug or how do I have to interpret this? Moreover, if you zoom into this plot, you will get more spiral cycles than there should be.


objo wrote at 2012-08-29 06:35:

Right, zoom and pan is not properly implemented for polar plots yet.

http://oxyplot.codeplex.com/workitem/9995

Multiple Axes: how to put the series to the correct axes

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

mreu wrote at 2012-08-22 14:19:

Hi

I build a plot with multiple axes (like the on in the axes demo) and I have a single serie for each of this axes, but all series are shown in the first axes. How to show the series in the corresponding axes?

Thanks a lot

Michael


ProCodeMyth wrote at 2012-08-23 02:25:

xyseries have aixs key property,you can set axis key


dcuccia wrote at 2012-09-12 00:57:

This is exactly what I was looking for, thanks!!

0

Strange axis working?

szs_szs vor 9 Jahren 0
I have strange problem with Axis how i think. I am trying to save Rectangle size and place with any axis. At first I am converting data points to screen points using Transform, then I save them converted points, after axis changing I am making Inversetransform of saved point's.
ChangeAxis- Transforms, saves, changing axes.
SetNewRectangle - Set new rectangle from saved points using InverseTransform.
The main question is why it's working when I am clicking ChangeAxis and then OldRectangle and not working when I am clicking on button "MakeAll" (encapsulates ChangeAxis,OldRectangle).


using OxyPlot;using OxyPlot.Annotations;
using OxyPlot.Axes;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication33
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
StrangeWithAxes swa = new StrangeWithAxes();
public MainWindow()
{
InitializeComponent();
DataContext = swa;
}

private void Button_Click_1(object sender, RoutedEventArgs e)
{
swa.ChangeAxis();
}

private void Button_Click_2(object sender, RoutedEventArgs e)
{
swa.SetNewRectangle();
}

private void Button_Click(object sender, RoutedEventArgs e)
{
swa.MakeAll();
}
}
public class StrangeWithAxes
{
public PlotModel PlotModel { get; set; }
LinearAxis XAxis { get; set; }
LinearAxis YAxis { get; set; }
RectangleAnnotation Rectangle { get; set; }
RectangleAnnotation TempRectangle { get; set; }
double xmin;
double xmax;
double ymin;
double ymax;
public StrangeWithAxes()
{
Rectangle = new RectangleAnnotation();
Rectangle.MinimumX = 10;
Rectangle.MinimumY = 10;
Rectangle.MaximumX = 20;
Rectangle.MaximumY = 20;
PlotModel = new PlotModel();
XAxis = new LinearAxis
{
Position=AxisPosition.Bottom,
Minimum=0,
Maximum=50,
};
YAxis = new LinearAxis
{
Position=AxisPosition.Left,
Minimum=0,
Maximum=50,
IsPanEnabled=false
};
PlotModel.Axes.Add(XAxis);
PlotModel.Axes.Add(YAxis);

PlotModel.Annotations.Add(Rectangle);

PlotModel.InvalidatePlot(true);

}
public void MakeAll()
{
ChangeAxis();
SetNewRectangle();
}
public void ChangeAxis()
{
TempRectangle = Rectangle;
xmin=XAxis.Transform(TempRectangle.MinimumX);
xmax=XAxis.Transform(TempRectangle.MaximumX);
ymin=YAxis.Transform(TempRectangle.MinimumY);
ymax=YAxis.Transform(TempRectangle.MaximumY);

XAxis = new LinearAxis
{
Position = AxisPosition.Bottom,
Minimum = 0,
Maximum = 100,
};
YAxis = new LinearAxis
{
Position = AxisPosition.Left,
Minimum = 0,
Maximum = 100,
IsPanEnabled = false
};
PlotModel.Axes.Clear();
PlotModel.Axes.Add(XAxis);
PlotModel.Axes.Add(YAxis);
PlotModel.InvalidatePlot(true);
}
public void SetNewRectangle()
{
PlotModel.Annotations.Clear();

Debug.WriteLine(xmin);
Debug.WriteLine(ymin);
Debug.WriteLine(xmax);
Debug.WriteLine(ymax);

Rectangle.MinimumX = XAxis.InverseTransform(xmin);
Rectangle.MinimumY = YAxis.InverseTransform(ymin);
Rectangle.MaximumX = XAxis.InverseTransform(xmax);
Rectangle.MaximumY = YAxis.InverseTransform(ymax);

PlotModel.Annotations.Add(Rectangle);
PlotModel.InvalidatePlot(false);
}
}
}

And xaml code:
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:oxy="http://oxyplot.org/wpf"
Title="MainWindow" Height="350" Width="525">
<Grid Margin="83,0,0,0">
<oxy:Plot Model="{Binding PlotModel}"></oxy:Plot>
<Button Content="ChangeAxis" HorizontalAlignment="Left" Margin="-80,36,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1"/>
<Button Content="SetNewRectangle" HorizontalAlignment="Left" Margin="-80,61,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_2"/>
<Button Content="MakeAll" HorizontalAlignment="Left" Margin="-80,11,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
</Grid>
</Window>





GridLines : Both

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

Elite182 wrote at 2013-03-06 15:46:

Hello ! and thank you very much for this work...

I want to put the style GridLines "Both" in my Plotter like ExampleBrowser , but i didn't find documentations to do it...

Someone help me ?

Thanks ! :)

objo wrote at 2013-03-13 21:33:

Try to set MajorGridlineStyle to LineStyle.Solid for both the horizontal and vertical axes.

unable to add DateTimeAxis to plot Model

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

Papst wrote at 2013-11-27 11:37:

Hi,

I'm trying to add a DateTimeAxis to a PlotModel using the OxyPlot.Wpf.DateTimeAxis and OxyPlot.PlotModel.

I'm getting an error since the DateTimeAxis is not derived from Oxyplot.Axes.Axis:
out of OxyPlot.Wpf Source:
public class DateTimeAxis : Axis
in here Axis is: OxyPlot.Wpf.Axis
0
Wird überprüft

Error: This PlotModel is already in use by some other PlotView control.

Alireza Jahanshahlo vor 10 Jahren aktualisiert von anonymous vor 10 Jahren 1
I have two tab bind to one viewmodel which contain a PlotModel and view model selected through a DataTemplate.
When click on the first tab the viewmodel was bind properly but when switch to second tab above exception throw.
All of control is same in two tab.
Is it possible bind one object to two controls?

How to configure the Click Event

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

Redzar wrote at 2013-08-21 19:56:

Hello people,
I'm using OxyPlot in a Windows 8 Metro App. When you click, for example in an area chart or a line chart, it appears a label with the values of the chart. The point is, can I change the event when I click by simply passing the mouse over?

Thank you. ^^

everytimer wrote at 2013-08-21 21:00:

That is not supported by the library right now.

Redzar wrote at 2013-08-22 10:04:

There is no way to modify de code and make it? :_(
What is the name of the label?

objo wrote at 2013-08-22 10:30:

It should be possible to set the DefaultTrackerTemplate property to null.
I will submit a fix that hopefully corrects this, will be available at nuget/download later today.
The same behaviour should be implemented on WPF/SL.

Redzar wrote at 2013-08-22 10:52:

Thank you very much!!
Please could you explain how to do it then? ^^

objo wrote at 2013-08-22 20:42:

I checked that this also work on WPF/SL.
Try to set DefaultTrackerTemplate={x:Null} on your Plot control.

Redzar wrote at 2013-08-23 10:10:

Hi Objo,
I downloaded the update and I set the Plot control like this:
<oxy:Plot Model="{Binding PlotModel}" DefaultTrackerTemplate="{x:Null}" Margin="10" BorderBrush="Transparent" Background="{x:Null}" />
But it doesn't work. The label doesn't appear clicking or moving the mouse.
Any idea?

Thanks ^^

everytimer wrote at 2013-08-23 12:26:

I think that disables the Tracker...

Redzar wrote at 2013-08-26 09:47:

So what do I do? My boss will kill me XD

objo wrote at 2013-08-26 11:14:

Redzar: not sure about what you are asking for, I guess I misunderstood - yes, setting the tracker template to null disables the tracker.

See also https://oxyplot.codeplex.com/discussions/454236 if you need to subscribe to the 'tracker changed' event

Redzar wrote at 2013-08-26 11:20:

I just want that when you pass the mouse over the chart, the Tracker is displayed automatically, without having to click.

objo wrote at 2013-08-26 11:46:

This is a feature request - see issue 9963
https://oxyplot.codeplex.com/workitem/9963

Issue 9802 is similar
https://oxyplot.codeplex.com/workitem/9802

Redzar wrote at 2013-08-26 11:50:

o_O
Sorry, I don't understand that post.

objo wrote at 2013-08-26 13:21:

Sorry, I don't think it is possible to show the tracker on mouse-over in the current version.

Redzar wrote at 2013-08-26 13:24:

Oki,
Objo, you know where could be the part of the code that would make it possible to try to do it myself? ^^
0
Wird überprüft

Oxyplot License for commercial use

Bhuwanesh .R vor 9 Jahren aktualisiert vor 9 Jahren 2

We are planning to use Oxyplot in our project with xamarin studio, Is there any limitations to use oxyplot free license in commercial products? Can it be used for commercial purpose?

0

Axis.MouseDown / Area Property

alex vor 9 Jahren aktualisiert von Mark Bean vor 3 Jahren 5

Hello,

I have tried to add a Event Handler for the Axis.MouseDown Event, but it doesn't get called!

FrequencyAxis.MouseDown += (s, e) => {

IsFrequencyAxisFixed = !IsFrequencyAxisFixed;

};

Also, would it be possible to add a Area property to the Axis? (Like the PlotModel.LegendArea or PlotModel.PlotArea)

0

UpdateMaxMin

Mark Bean vor 9 Jahren 0

New to OxyPlot and OpenSource coding. Have plotted some LineSeries, altered mousing to zoom in and out, but would like the plot to normalize the data being plotted as we zoom in. To do this I need access to MaxY of the data series (see also UpdateMaxMin()). Easy to calculate and implement, but I see that OxyPlot has protected internals offering this already, only I cannot access those from an Example to normalize the data. Is the correct approach to inherit fom a class that implements and exposes this and use my inherited class rather than LineSeries? 2nd, is there a good reason why such integral properies are internal and protected, not public? Sorry if this is a stupid question.