
Data update in SizeChanged
anomistu wrote at 2012-03-05 14:06:
Hi,
Shouldn't "InvalidatePlot()" be called with a "false" parameter in Plot's OnSizeChanged handler?
I think there's no reason to update data when resizing.
objo wrote at 2012-03-05 21:39:
you are right, will fix this soon. thanks!
objo wrote at 2012-03-12 06:30:
corrected in change set 9c07df0f6432

LabelFormatString to display other values other than x/y coordinates
michaeldjackson wrote at 2013-07-22 22:16:
For example, I have a file containing two sections:
Section 1 (x, y, width, temperature)
0.00000 8008.00000 303.89111
2.07055 8007.72754 286.60547
4.00000 8006.92822 274.70264
etc
Section 2 (vertexes)
1, 44, 45, 2
2, 45, 46, 3
3, 46, 47, 4
etc
Section 2 tells me in what order to plot the x/y coordinates from Section 1, so the first line in Section 2 says to plot points in line 1, then points in line 44, then points in line 45, then points in line 2 (of Section 1), etc.
I need to use LabelFormatString to display the vertex values, ie 1, 44, 45, 2, etc rather than the x/y coordinates.
Is this possible and how?
MDJ
everytimer wrote at 2013-07-22 22:43:
Good luck
michaeldjackson wrote at 2013-07-22 23:56:
Actually, it's NOT for the Tracker. I need to show the Index number for each vertex, AND, hopefully bind it's visibility in XAML to allow user to show/hide it.
If that's not possible, I could resort to the Tracker.
everytimer wrote at 2013-07-23 00:30:
for(int i=0; i<s2.Points.Count(); i++)
{
s1.Points.Add(new DataPoint(myList1X[i],myListY[i] );
s1.LabelFormatString = (s2.Points[i].X, s2.Points[i].Y)
}
Please note that I haven't tested this (you would probable need ToString() that).
For disabling that you could put a condition before LabelFormatString and redraw the LineSeries whenever the user clicks on that particular CheckBox. Good luck

Can't get OxyPlot.XamarinAndroid working.
Death69 wrote at 2014-05-30 12:30:
I'm trying to make a simple Testapplication that shows some stuff. I'm using the latest Xamarin.Android build and the latest OxyPlot build that i got via nuget. But i always get an
Unhandled Exception:What am i doing wrong?
System.MissingMethodException: Method not found: 'OxyPlot.PlotModel.Update'.
Here is my source code.
My Model:
using System;
using System.Collections.Generic;
using System.Text;
using OxyPlot;
using OxyPlot.XamarinAndroid;
using OxyPlot.Series;
using OxyPlot.Axes;
using Android.App;
using Android.OS;
namespace OxyPlotTest.Resources
{
public class MainViewModel
{
public PlotModel MyModel { get; set; }
public MainViewModel()
{
// Below from http://oxyplot.org/doc/HelloWpf.html
//MyModel = new PlotModel("Example 1");
//MyModel.Series.Add(new FunctionSeries(Math.Cos, 0, 10, 0.1, "cos(x)"));
// Below from http://oxyplot.codeplex.com/wikipage?title=WpfExample1
PlotModel temp = new PlotModel("Square wave");
var ls = new LineSeries("sin(x)+sin(3x)/3+sin(5x)/5+...");
int n = 10;
for (double x = -10; x < 10; x += 0.0001)
{
double y = 0;
for (int i = 0; i < n; i++)
{
int j = i * 2 + 1;
y += Math.Sin(j * x) / j;
}
ls.Points.Add(new DataPoint(x, y));
}
temp.Series.Add(ls);
temp.Axes.Add(new LinearAxis(AxisPosition.Left, -4, 4));
temp.Axes.Add(new LinearAxis(AxisPosition.Bottom));
MyModel = temp;// this is raising the INotifyPropertyChanged event
}
}
}
The Activity:[Activity(Label = "OxyPlotEx", MainLauncher = true)]
public class OxyPlotEx : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
MainViewModel MyMainViewModel = new MainViewModel();
SetContentView(Resource.Layout.OxyPlotEx);
var plotView = FindViewById<PlotView>(Resource.Id.plotView_Temp);
plotView.Model = MyMainViewModel.MyModel;
}
}
objo wrote at 2014-06-06 21:13:
Activity
class, it looks ok to me. The
Update
method was recently removed from the public API because it should not be called by the client apps, only by the
PlotView
controls. Death69 wrote at 2014-06-10 12:05:
i got the latest commit and build the xamarainandroid and oxyplot .dll's and now it's working. I got OxyPlot via NuGet before. But i had to delete the
<input ="StyleCop...> in OxyPlot.csproj
objo wrote at 2014-06-10 13:41:
Make sure the OxyPlot and OxyPlot.XamarinAndroid packages have the same version number.
objo wrote at 2014-06-11 12:11:
Death69 wrote at 2014-06-11 15:28:
as is said i removed it before building the library and it worked.
I may have found a bug, but I'm not sure if it really is one or I'm just don't use it right.
In my project I have a ColumnSeries and i put alot of ColumnItems in it (~50) and it should start from a desired position with the CategoryAxis.StartPosition property but there is nothing drawn in the PlotModel. It actually deletes the hole CategoryAxis. I need to set it to an explicit value from the items i get. I need to show data between specific ages (from 40 to 95) then i need to let it start from 40.
It would be good if the CategoryAxis labels could be invisible, with the amount of ColumnItems i have it looks really ugly, because they're overlaping. Or something like showing every fifth position.
Btw: Great Library, it's really really powerful. Excellent work.

Legend position in PieSeries
Patoon wrote at 2013-01-31 14:56:
Is there any way to place the legend in an outside box instead of inside the slices ?
Thank you.
objo wrote at 2013-02-07 22:41:
{0} is replaced by the value, and {1} by the label (legend).
patoon wrote at 2013-02-08 08:17:
What you propose give labels above corresponding slices, and I try to have label stacked together in a separate box outside of the pie.
Do you think it's possible ?
Thank you.
objo wrote at 2013-02-10 23:00:
It is possible to subclass the PieSeries class and override the Render method to draw the labels. Please share if you implement the feature :)
patoon wrote at 2013-02-11 07:21:

How to convert mouse coordinates to X-Y plot coordinates in WindowsForms?
funkerkat wrote at 2013-10-15 10:38:
Is it possible to get mouse coordinates converted to X-Y plot coordinates? I use OxyPlot lib for WindowsForms. I want to get mouse coordinates X-Y in mouse event handler (MouseClick for example). I know similiar functionality is realized in WPF lib, but as I know tracker is not implemented in WindowsForms.
I'm a newbie, please help me to solve this problem, i'll appreciate any advices! If it needs to modify lib please show me with which classes I should work...
objo wrote at 2013-10-15 15:05:

Latest Alpha - Plot's Context Menu

Programmatically add graph to XAML form C#
SheDan wrote at 2014-04-08 22:47:
I have to add different graphs in each new tab in TabControl. So I can't just write in XAML something like this:
<oxy:Plot x:Name="Plot1" Title="A Graph" Model="{Binding PlotModel}">
I tried adding to Canvas using .Children.Add()
but it doesn't work >_<
How can I add graph to my form from C# code during the runtime??
everytimer wrote at 2014-04-09 22:16:
In ViewModel:
PlotModel.Series.Add(ls);
SheDan wrote at 2014-04-09 22:27:
everytimer wrote at 2014-04-10 20:43:
MyPlot1.Model.Series.Add(ls);
You should be using templates and bind a collection of PlotModels to a custom UserControlm
How To Set "Figure Number Text Display" Off
hasancan wrote at 2013-02-24 09:27:
I was using HTMLReportWriter class and I added an image to my html report but I don't want it to display Figure X text. Even though I do not set any text, it displays Figure X by default. I tried setting FigureTextFormatString to blank but nothing changed...

NuGet for WinForms
ta wrote at 2012-03-30 13:46:
Hi,
I was wondering if there are plans to add nuget packages for winforms at some point? It would be very much appreciated.
objo wrote at 2012-03-30 14:58:
Yes, I will add a nuget package for winforms.
I would also like to create a comparison of performance on WPF, Silverlight and Winforms (I guess the Winforms implementation will do quite well!)
objo wrote at 2012-04-03 10:03:
I have added the nuget package - see http://nuget.org/packages/OxyPlot.WindowsForms.
Ps. There is a bug when using the toolbox to add a Plot control to a form, something is wrong with the Model assignment - will solve this later (http://oxyplot.codeplex.com/workitem/9952).
ta wrote at 2012-04-10 10:01:
Thank you so much. I am now using the nuget package.
The only small hick up was that IAxis and ISeries does not seem to be available in the dll from nuget. (maybe they are no longer used? - I did not check the source) I just replaced them with the usage of the interfaces with var's and now it works perfectly.
objo wrote at 2012-04-10 22:51:
Yes, the interfaces (IAxis, ISeries and IAnnotation) were removed. Change to use the Axis, Series and Annotation base classes.
Customer support service by UserEcho