
How to ensure square plot area?
viklele wrote at 2012-11-20 07:47:
Hi,
In my application, I need to ensure that the actual plot area where the chart is drawn in always square.
Please advice - sample code welcome.
Thanks,
Warm Regards,
- Vikram
objo wrote at 2012-11-26 06:12:
I think you can change the "PlotMargins" of the plot each time the size of the plot changes...
Or make sure the size of the control is square (handle the sizechanged event on the control or override the coerce value callbacks on the width/height dependency properties?).
viklele wrote at 2012-11-26 06:42:
Thanks for your reply.
I understand that I need to adjust plot margins in resize event of the control. I am not clear about the calculation. I have adjusted margins using height / width of the control, and height / width of the title area. This still does not make the plot area square. Here is my calculation:
private void AdjustPoincareChartMargins(Plot plot, double dWidth, double dHeight) { Debug.WriteLine("Available W: " + dWidth + ", H: " + dHeight); plot.Model.IsLegendVisible = false; var availableWidth = dWidth; var availableHeight = dHeight - plot.Model.TitleArea.Height; var horzMargin = Math.Max(0, (availableWidth - availableHeight)) / 2; var vertMargin = Math.Max(0, (availableHeight - availableWidth)) / 2; plot.Model.PlotMargins = new OxyPlot.OxyThickness(horzMargin, vertMargin, horzMargin, vertMargin); Debug.WriteLine("Plot W: " + plot.Model.PlotArea.Width + ", H: " + plot.Model.PlotArea.Height); Debug.WriteLine("PlotAndAxisArea W: " + plot.Model.PlotAndAxisArea.Width + ", H: " + plot.Model.PlotAndAxisArea.Height); }
Thanks,
- Vikram

Scatter Series and HeatMap
Artiga wrote at 2013-08-19 10:53:
When I tried to plot a scatter Series and a HeatMap together, the scatter points are not visible, how I fix that?
Thx for all !!!
objo wrote at 2013-08-19 11:01:
Artiga wrote at 2013-08-19 11:13:
Artiga wrote at 2013-08-19 12:04:

Is it possible or planned...
ffiala wrote at 2012-02-21 07:45:
- ...to overlay different ploting series in one ploting area?
- ...to add annotations to each datapoint?
- ...to position these annotations outside of the ploting area?
The result shoud be something like this:
objo wrote at 2012-02-23 21:08:
Yes, you can overlay any number of plotting series in the same plot - it should not be any problem to combine line, scatter points and columns (bar) series as in your example.
You can create a string for each data point that will be shown when you use the mouse tracker, but currently only the BarSeries has the ability to render labels (will add this to the other series later).
You can create your own custom annotatiosn that renders in screen coordinates, anywhere in the control area.
You could also create a custom x-axis to render the club names. Simply override the Render method.
ffiala wrote at 2012-02-26 12:56:
I have now an OxyPlot version of my plot:
Using the Oxyplot library without changes of source code.
Thank You for support, Franz

Can't programmatically binding to OxyPlot properties
richardfen wrote at 2014-03-25 00:18:
objo wrote at 2014-03-25 20:58:
OxyPlot.Wpf.Series.ColorProperty
. It is public and the type is
System.Windows.Media.Color
richardfen wrote at 2014-03-26 19:35:
var ls = new OxyPlot.Wpf.LineSeries();
var b = new Binding();
b.Source = mySourceObject;
b.Path = new PropertyPath("Color");
b.Mode = BindingMode.TwoWay;
ls.SetBinding(OxyPlot.Wpf.Series.ColorProperty, b);
This code compiles perfectly but when I try to add the LineSeries to the model it won't compile: PlotModel model
model.Series.Add(ls)
I get an error telling me that "ls" is the wrong type. It is expecting the non-WPF LineSeries. I have looked for a WPF version of PlotModel but can't find any. Thanks for you help.objo wrote at 2014-03-26 20:55:
OxyPlot.Wpf.LineSeries
to the OxyPlot.PlotModel
. Try adding the "ls" to the
Series
collection in your OxyPlot.Wpf.Plot
control.
The TrackerControl template must contain a content container exception
I am using OxyPlot.WIndowsUniversal 2014.1.546.0 in a win8.1 project. I am trying to create a chart witth a category axis, a linear axis and a line series. Below is the code that creates the chart.
var chartModel = new PlotModel(); CategoryAxis categAxis = new CategoryAxis(); categAxis.Position = AxisPosition.Bottom; categAxis.ItemsSource = chartvm.DateValues; categAxis.LabelField = "MN"; categAxis.IsTickCentered = true; categAxis.IsZoomEnabled = false; categAxis.IsPanEnabled = false; categAxis.MaximumPadding = 0; categAxis.MinimumPadding = 0; chartModel.Axes.Add(categAxis); LinearAxis linAxis = new LinearAxis(); linAxis.Position = AxisPosition.Left; linAxis.IsPanEnabled = false; linAxis.IsZoomEnabled = false; linAxis.MaximumPadding = 0; linAxis.MinimumPadding = 0; linAxis.LabelFormatter = ((double d) => String.Format("{0:0.00€}", d)); chartModel.Axes.Add(linAxis); var series = new AreaSeries { Color = OxyColor.FromArgb(255, 78, 154, 6), DataFieldX2 = "OxySeriesValue", DataFieldY2 = "OxyZeroValue", DataFieldX = "OxySeriesValue", DataFieldY = "Value", MarkerType = MarkerType.Circle, MarkerSize=3, MarkerFill = OxyColor.FromRgb(0, 117, 235), ItemsSource = chartvm.DateValues, }; series.Color = OxyColor.FromRgb(0, 117, 235); series.Color2 = OxyColor.FromRgb(0, 117, 235); chartModel.Series.Add(series); var children = AllChildren(ChartSection); PlotView plotView = children[8] as PlotView; plotView.Model = chartModel;It all works well until the tracker is required to show. Whrn that happens the following exception occurs.
System.InvalidOperationException: The TrackerControl template must contain a content container with name +'PART_ContentContainer'
at OxyPlot.WindowsUniversal.TrackerControl.OnApplyTemplate()
Does anybody know why the exception is thrown??
Thanks in advance !!

OxyPlot.XamarinFormsAndroid error LinkAssemblies
I just installed the OxyPlot NuGet packages in my project (a XamarinForms PCL) and I get this error when I try to compile:
Error
1
Error inesperado en la tarea "LinkAssemblies".
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'Xamarin.Forms.Platform.Android.ViewRenderer`2' (defined in 'OxyPlot.XamarinFormsAndroid, Version=2014.1.517.0, Culture=neutral, PublicKeyToken=null') from 'OxyPlot.XamarinFormsAndroid, Version=2014.1.517.0, Culture=neutral, PublicKeyToken=null' could not be resolved.
en Xamarin.Android.Diagnostic.Error(Int32 code, String message, Object[] args)
en Xamarin.Android.Tasks.LinkAssemblies.Execute()
en Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
en Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
Chupeta.Android
If I remove OxyPlot.XamarinFormsAndroid from the references of the Android project it compiles fine, but then I can't use OxyPlot (I can't make the call to OxyPlot.XamarinFormsAndroid.Forms.Init(); )
Thanks.

OxyPlot.WPF.RectangleAnnotation no text when using code
DShawNitec wrote at 2013-06-01 01:13:
The rectangle shows with the correct outline color and fill color in the right location but no text.
Plot has a DateTimeAxis at the bottom, normal vertical axis on left.
We are using the following:
ra = new OxyPlot.Wpf.RectangleAnnotation();
ra.MinimumX = OxyPlot.Axes.DateTimeAxis.ToDouble(ll);
ra.MaximumX = OxyPlot.Axes.DateTimeAxis.ToDouble(llW);
ra.MinimumY = yBot;
ra.MaximumY = yTop;
ra.Fill = Colors.White;
ra.Stroke = Colors.Black;
ra.StrokeThickness = 2;
ra.ClipToBounds = false;
ra.Text = " Case Colors";
ra.Layer = AnnotationLayer.AboveSeries;
ra.TextRotation = 0.0;
CaseComparePlot.Annotations.Add(ra);
Any suggestions on what's missing?DShawNitec wrote at 2013-06-03 18:22:
objo wrote at 2013-06-08 10:53:

Change axis textcolor in OxyPlot for WPF
Artholl wrote at 2014-07-07 22:50:
So my question is: Is there some way how I can achieve this?
I also posted question on StackOverflow.
objo wrote at 2014-07-10 12:40:
I also think we should add a OxyPlot.Wpf.PlotElement class and let the Axis class inherit from this!
Artholl wrote at 2014-07-10 13:12:

oxyplot - 2014.1.245.1 get_ActualFont Error
nithinshiriya wrote at 2014-03-12 21:12:
Object reference not set to an instance of an object.
at OxyPlot.PlotElement.get_ActualFont() in c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\PlotModel\PlotElement.cs:line 106
at OxyPlot.Axes.Axis.Measure(IRenderContext rc) in c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\Axes\Axis.cs:line 985
at OxyPlot.PlotModel.MaxSizeOfPositionTier(IRenderContext rc, IEnumerable1 axesOfPositionTier) in c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\PlotModel\PlotModel.Rendering.cs:line 174
at OxyPlot.PlotModel.AdjustAxesPositions(IRenderContext rc, IList1 parallelAxes) in c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\PlotModel\PlotModel.Rendering.cs:line 249
at OxyPlot.PlotModel.AdjustPlotMargins(IRenderContext rc) in c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\PlotModel\PlotModel.Rendering.cs:line 212
at OxyPlot.PlotModel.Render(IRenderContext rc, Double width, Double height) in c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\PlotModel\PlotModel.Rendering.cs:line 76
at OxyPlot.Wpf.Plot.UpdateVisuals() in c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot.Wpf\Plot.cs:line 1119
at OxyPlot.Wpf.Plot.ArrangeOverride(Size arrangeBounds) in c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot.Wpf\Plot.cs:line 564
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)

New Release documentation
njh86 wrote at 2014-06-13 12:56:
Apparently OxyPlot.WindowsForms.Plot is deprecated, amongst other errors.
Can anyone point me in the direction of a change log as I can't seem to find any?
Thanks
objo wrote at 2014-06-14 08:55:
https://oxyplot.codeplex.com/SourceControl/list/changesets
I would like to auto create a description of all changes in each build, but I have not found a way to do this yet. Need a map between build numbers and hg changeset numbers...
Servicio de atención al cliente por UserEcho