Strange behavior of XAML polar demo
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.
Multiple Axes: how to put the series to the correct axes
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!!
Strange axis working?
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
Elite182 wrote at 2013-03-06 15:46:
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:
MajorGridlineStyle
to LineStyle.Solid
for both the horizontal and vertical axes.unable to add DateTimeAxis to plot Model
Papst wrote at 2013-11-27 11:37:
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.AxisError: This PlotModel is already in use by some other PlotView control.
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
Redzar wrote at 2013-08-21 19:56:
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:
Redzar wrote at 2013-08-22 10:04:
What is the name of the label?
objo wrote at 2013-08-22 10:30:
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:
Please could you explain how to do it then? ^^
objo wrote at 2013-08-22 20:42:
Try to set
DefaultTrackerTemplate={x:Null}
on your Plot
control.Redzar wrote at 2013-08-23 10:10:
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:
Redzar wrote at 2013-08-26 09:47:
objo wrote at 2013-08-26 11:14:
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:
objo wrote at 2013-08-26 11:46:
https://oxyplot.codeplex.com/workitem/9963
Issue 9802 is similar
https://oxyplot.codeplex.com/workitem/9802
Redzar wrote at 2013-08-26 11:50:
Sorry, I don't understand that post.
objo wrote at 2013-08-26 13:21:
Redzar wrote at 2013-08-26 13:24:
Objo, you know where could be the part of the code that would make it possible to try to do it myself? ^^
Oxyplot License for commercial use
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?
Axis.MouseDown / Area Property
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)
UpdateMaxMin
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.
Servicio de atención al cliente por UserEcho