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

Width of an axis

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

jcma86 wrote at 2014-08-07 17:31:

Good day!

How can I get the actual width of an axis?

Thank you!

objo wrote at 2014-08-08 10:36:

try setting the PlotModel.PlotMargins!

Any interest in a gauge control?

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

Johan20D wrote at 2014-07-18 07:57:

We played around and wrote a Gauge control. Does Oxyplot want it?

HeatMapSeries Axis Problems [Solved]

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

guevara123 wrote at 2013-03-08 13:21:

Hello !


I am currently trying to create a STFT Plot with HeatMapSeries, but i encountered a problem with setting the axis right..

Image
As you can see both axis have the same size and i dont know why.. My time-Axis(x-Axis) should be much smaller. The strange thing is, when I plot the HeatMap with flipped Axis( time- axis = y- axis, frequency axis -> x-axis ), than the plot is correctly drawn.

Here the interesting parts of the code:
 double x0 = 0;
 double x1 = currentTime; 
 double y0 = 0;
 double y1 =  maxFrequency;
 peaksData = .magnitudedata; // double[currenTime.Length, maxFrequency.Length]
heatMap = new HeatMapSeries { X0 = x0, X1 = x1, Y0 = y0, Y1 = y1, Data = peaksData };
            
            temp.Series.Add(heatMap);            
            var cs = new ContourSeries
            {
                Color = OxyColors.Black,
                FontSize = 0,
                ContourLevelStep = 1,
                LabelBackground = null,
                ColumnCoordinates =timeValues, //array with length = currenTime(rounded)
                RowCoordinates= frequenyValues,//array with length = maxFrequency
                Data = peaksData
            };
The same happens for the HeatMapSeries Example when I change the values to,
            double x0 = 3;
            double x1 = 4;
            double y0 = 5;
            double y1 = 8;
then i will get a lot of white space in the Plot..



Thanks in advance for your help.

guevara123 wrote at 2013-03-11 20:23:

Can noone help here?

guevara123 wrote at 2013-03-13 14:29:

There is a bug in HeatMapseries:
    /// <summary>
    /// Updates the max/minimum values.
    /// </summary>
    protected internal override void UpdateMaxMin()
    {
        [...]

        this.XAxis.Include(this.MinX);
        this.XAxis.Include(this.MaxX);
        this.YAxis.Include(this.MinY);     //this.XAxis.Include(this.MinY);
        this.YAxis.Include(this.MaxY);    //this.XAxis.Include(this.MaxY);
       [...]
    }


objo wrote at 2013-03-13 20:28:

Thanks for the bug report and solution! I have submitted the change.

NejibCh wrote at 2013-04-27 05:53:

I had some issues and liked to share after I solved them.
I had many challenges to set the contours, contour labels and colorAxis position (Needed to add a transparent axis to push the ColorAxis further for plotArea)
By the way this is great tool. Much better than some marketed tools "like Infragistics for example).
Good job guys.

!!!!!!!!!!!!!!!!!!!!!!!!!!! ----------------------- in the XAML

<Window x:Class="TreeMapInfragistics.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf"
    xmlns:oxy2="clr-namespace:OxyPlot.Series;assembly=OxyPlot"
    Title="MainWindow" Height="610" Width="610">
<Grid>
    <oxy:Plot x:Name="MyOxyPlot" Model="{Binding MyPlotModelTab3}"/>
</Grid>
</Window>


!!!!!!!!!!!!!!!!!!!!!!!!!!! ----------------------- in the ViewModel

using System;
using System.Linq;
using OxyPlot;
using OxyPlot.Axes;
using OxyPlot.Series;

namespace HeatMapWithContours
{
public class MainViewModel: BaseViewModel
{
    public double [] mnMxXY = new double[6];
    public double[] WOB;
    public double[] RPM;

    public MainViewModel()
    {
        UpdateChart();
    }

   // ..........................................
   private PlotModel _myPlotModelTab3;
   public PlotModel MyPlotModelTab3
   {
       get { return _myPlotModelTab3; }
       set
       {
           _myPlotModelTab3 = value;
           OnPropertyChanged("MyPlotModelTab3");
       }
   }

   public void UpdateChart()
   {
       double[,] MyData = GenerateData();

       #region  HeatMapSeries

       var hm = new HeatMapSeries();
       hm.Data = MyData;
       hm.Selectable = false;
       hm.X0 = mnMxXY[0]; // Min X-axis
       hm.X1 = mnMxXY[1]; // Max X-axis

       hm.Y0 = mnMxXY[2]; // Min Y-axis
       hm.Y1 = mnMxXY[3]; // Max Y-axis

       #endregion

       #region ContourSeries

       var cs = new ContourSeries()
       {
           // ..............
           ColumnCoordinates = WOB, //yvalues
           RowCoordinates = RPM,//xvalues
           Data = MyData,

           // ............
           ContourLevelStep = 5,
           StrokeThickness = 0.5,
           LineStyle = LineStyle.Solid,
           Color = OxyColors.Gray,
           //ContourColors = new[] { OxyColors.SeaGreen, OxyColors.RoyalBlue, OxyColors.IndianRed },

           // ...............
           LabelFormatString = "[0.00]",
           LabelBackground = null,
           //LabelSpacing  = double.NaN,
           //Font = null,
           //LabelStep = 10,
           FontSize = 11,
           FontWeight = FontWeights.Normal,
           TextColor = OxyColors.Black
           //Background = OxyColor.FromAColor(220, OxyColors.White),
           //TrackerFormatString = null,

       };

       #endregion

       #region X- Axis

       LinearAxis xAxis = new LinearAxis
       {
           Position = AxisPosition.Bottom,
           Title = "RPM",
           ClipTitle = true,
           TitlePosition = 0.5,
           MinorGridlineStyle = LineStyle.Dot,
           MajorGridlineStyle = LineStyle.Dot,
           MinorGridlineThickness = 1,
           MajorGridlineThickness = 1,
           IsAxisVisible = true,
           IsZoomEnabled = false,
           IsPanEnabled = false,
           Angle = 0,
           AxisTitleDistance = 4,
           AxisTickToLabelDistance = 4,
           MajorTickSize = 7,
           MinorTickSize = 4,
           Minimum = mnMxXY[0],
           Maximum = mnMxXY[1],
           ShowMinorTicks = true
       };

       #endregion

       #region Y- Axis

       LinearAxis yAxis = new LinearAxis
       {
           Position = AxisPosition.Left,
           Title = "WOB",
           ClipTitle = true,
           TitlePosition = 0.5,
           MinorGridlineStyle = LineStyle.Dot,
           MajorGridlineStyle = LineStyle.Dot,
           MinorGridlineThickness = 1,
           MajorGridlineThickness = 1,
           IsAxisVisible = true,
           IsZoomEnabled = false,
           IsPanEnabled = false,
           Angle = 0,
           AxisTitleDistance = 4,
           AxisTickToLabelDistance = 4,
           MajorTickSize = 7,
           MinorTickSize = 4,
           Minimum = mnMxXY[2],
           Maximum = mnMxXY[3],
           ShowMinorTicks = true
       };

       #endregion

       #region Y1- Axis

       LinearAxis y2Axis = new LinearAxis
       {
           Position = AxisPosition.Right,
           IsAxisVisible = true,
           IsZoomEnabled = false,
           IsPanEnabled = false,

           TicklineColor = OxyColors.Transparent,
           AxislineColor = OxyColors.Transparent,
           TextColor = OxyColors.Transparent
       };

       #endregion

       #region ColorAxis

       ColorAxis cAxis = new ColorAxis
       {
           Position = AxisPosition.Right,
           PositionTier = 1,
           Palette = OxyPalettes.Jet(500),
           HighColor = OxyColors.Red,
           LowColor = OxyColors.Blue,
           Minimum = mnMxXY[4],
           Maximum = mnMxXY[5],
           StartPosition = 0.05,
           EndPosition = 0.95,
           IsAxisVisible = true,
           Angle = 0,
           AxisTitleDistance = 4,
           AxisTickToLabelDistance = 4,
           MajorTickSize = 7,
           MinorTickSize = 4,
           ShowMinorTicks = true,
           UseSuperExponentialFormat = true
       };

       #endregion

       #region PlotModel

       PlotModel tempPlotModel = new PlotModel();

       tempPlotModel.AutoAdjustPlotMargins = true;
       tempPlotModel.PlotAreaBackground = OxyColors.Red;
       tempPlotModel.Title = "Critical Speed Map (XPos)";
       tempPlotModel.TitleFontWeight = FontWeights.Normal;
       tempPlotModel.PlotAreaBorderThickness = 1;
       tempPlotModel.PlotAreaBorderColor = OxyColors.Black;

       tempPlotModel.Axes.Add(xAxis);
       tempPlotModel.Axes.Add(yAxis);
       tempPlotModel.Axes.Add(y2Axis);

       tempPlotModel.Axes.Add(cAxis);
       tempPlotModel.Series.Add(hm);
       tempPlotModel.Series.Add(cs);

       #endregion

       MyPlotModelTab3 = tempPlotModel;
  }

   #region Generate Data

   private double[,] GenerateData()
   {
            ..........
       }
}
}

Steps with LogarithmicAxis

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

WeirdNoise wrote at 2013-07-22 14:08:

Hello,
I'm trying to put together a little tool for displaying audio measurements. Such plots do usually have two logarithmic axes, though the amplitude axis is scaled linear by using dB.

The frequency axis, however, should be scaled logarithmic and has to cover approximately the human range of audibility from 20 Hz to 20 kHz. If I set up a plot using a logarithmic oxyPlot, I get something like this:
Image

I would like to have more displayed Steps (frequency labels) on the frequency axis, like this:
Image

Obviously, I can't just adjust the Axis' Base, as I would get rather odd numbers. Is there any way to achieve such an axis labeling with oxyPlot?

Thanks in advance

everytimer wrote at 2013-07-23 12:28:

I don't think it's possible right now. You should modify the GetTickValues method inside the LogarithmicAxis.cs file (particularly majorTickValues list). Please post the solution if you find out how to do it. Good luck.

willmoore88 wrote at 2013-08-07 09:15:

If you're not bothered about the minor ticks being the same size as major ticks then this is a bit of a hacky way to do this. Just change the minor ticks to major ticks.

Inside LogarithmicAxis.cs, GetTickValues()....
                    if (d2 >= this.ActualMinimum && d2 <= this.ActualMaximum)
                    {
                        //minorTickValues.Add(d2);
                        majorTickValues.Add(d2);
                    }

WeirdNoise wrote at 2013-08-11 17:20:

Hello there,
it's been a while... Finally got to work on this.
everytimer: Thanks for pointing me in the right direction!

Main differences between my implementation and original (assuming base=10, but works with any other base):
-You can zoom out and display many decades without messing up the labels
-A Decade is subdivided if there's enough space for the labels
-The IntervalLength property is actually used by the algorithm

Example:
Image

For several reasons, I did my fix in the form of a simple override.
In case anyone's interested and not bothered by a little VB:
Imports System.Math

Public Class MyLogAxis
    Inherits Axes.LogarithmicAxis

    Public Overrides Sub GetTickValues(ByRef majorLabelValues As IList(Of Double), ByRef majorTickValues As IList(Of Double), ByRef minorTickValues As IList(Of Double))

        majorTickValues = New List(Of Double)
        minorTickValues = New List(Of Double)

        Dim screensize As Integer
        If Me.IsHorizontal Then
            screensize = Me.ScreenMax.X - Me.ScreenMin.X
        Else
            screensize = Me.ScreenMax.Y - Me.ScreenMin.Y
        End If

        Dim totalBW As Double = Log(Me.ActualMaximum, Me.Base) - Log(Me.ActualMinimum, Me.Base)
        Dim BWratio As Double = width / totalBW

        If totalBW < 1 Then
            MyBase.GetTickValues(majorLabelValues, majorTickValues, minorTickValues)

        ElseIf BWratio < Me.IntervalLength Then
            Dim steps As Integer = Ceiling(Me.IntervalLength / BWratio)
            Dim c As Double = Ceiling(Log(Me.ActualMinimum, Me.Base))

            While c < Floor(Log(Me.ActualMaximum, Me.Base))
                minorTickValues.Add(Round(Pow(Me.Base, c), 10))
                If c Mod steps = 0 Then
                    majorTickValues.Add(Round(Pow(Me.Base, c), 10))
                End If
                c += 1
            End While

        Else
            Dim c As Double = Floor(Log(Me.ActualMinimum, Me.Base))
            Dim v As Double
            Dim c2 As Double
            Dim lower As Double
            While c < Ceiling(Log(Me.ActualMaximum, Me.Base)) + 1

                v = Pow(Me.Base, c)
                If v > Me.ActualMinimum And v < Me.ActualMaximum Then
                    majorTickValues.Add(Round(v, 10))
                End If

                Dim a As Integer = 1
                lower = c

                While a < Me.Base
                    c2 = c + Log(a, Me.Base)
                    v = Pow(Me.Base, c2)
                    If v + 0.00001 >= Me.ActualMinimum And v <= Me.ActualMaximum + 0.00001 Then
                        minorTickValues.Add(Round(Pow(Me.Base, c2), 10))
                        If BWratio * Min(c2 - lower, c + 1 - c2) > Me.IntervalLength Then
                            majorTickValues.Add(Round(v, 10))
                            lower = c2
                        End If
                    End If

                    a += 1
                End While
                c += 1
            End While
        End If
        majorLabelValues = majorTickValues
    End Sub
End Class

everytimer wrote at 2013-08-11 19:38:

Great stuff, and good looking graph =)
0

Flip view not changing view because of Plotview?

sunil joshi 9 jaar geleden 0
hi,i am developing windows phone app. in my app i have a flip view which contains plotview and other controls. Flip view not changing the view when Plotview is on top. once i change the view by putting some extra space under Plotview it start working.

I think the swipe gesture not working when Plotview is on top.

Rectangle and Ellipse Selection Colour

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

Slxe wrote at 2014-05-16 18:40:

Hello again, just figured I'd mention something I noticed while playing around:

It seems like both RectangleAnnotation and EllipseAnnotation aren't checking if they're selected and changing the fill colour if they are. Noticed the slight difference when reviewing the source if it helps (in each's render methods):

PolygonAnnotation:
 rc.DrawClippedPolygon(
    this.screenPoints,
    clipping,
    MinimumSegmentLength * MinimumSegmentLength,
    this.GetSelectableFillColor(this.Fill),
    this.GetSelectableColor(this.Color),
    this.StrokeThickness,
    this.LineStyle,
    this.LineJoin);
and in PathAnnotation:
rc.DrawClippedLine(
   this.screenPoints,
   clippingRectangle,
   MinimumSegmentLength * MinimumSegmentLength,
   this.GetSelectableColor(this.Color),
   this.StrokeThickness,
   dashArray,
   this.LineJoin,
   this.aliased,
   null,
   clippedPoints.AddRange);
vs

RectangleAnnotation:
rc.DrawClippedRectangle(this.screenRectangle, clipping, this.Fill, this.Stroke, this.StrokeThickness);
and in EllipseAnnotation:
rc.DrawClippedEllipse(clipping, this.screenRectangle, this.Fill, this.Stroke, this.StrokeThickness);
Not sure if this is intended, but figured I'd point it out.

objo wrote at 2014-05-16 19:53:

thanks for the bug report! this should be easy to fix :-)

objo wrote at 2014-05-17 06:24:

This should be corrected now. We should add some examples, I don´t think I have ever tried if this works!
I also aligned the DrawClipped* methods, now the clipping rectangle is the first parameter in all these methods.

Slxe wrote at 2014-05-17 15:42:

Nice! Thanks for the quick replies =) this really helps. I'm at home right now, and don't have VS installed (since I only really do C#/.Net at work right now, Java/Clojure/Python at home), or my code, but here's basically what I'm using it for in the drawing toolbar demo I'm almost done:
private void Annotation_OnMouseDown(object sender, OxyMouseDownEventArgs args) 
{
    if (((Annotation) sender).IsSelected())
        ((Annotation) sender).UnSelect();
    else
        ((Annotation) sender).Select();
}

private void uiSelectAnnotsButton_OnCheckedChanged(object sender, EventArgs args) 
{
    foreach (Annotation a in ChartModel.Annotations)
    {
        if (((ToolStripButton) sender).Checked)
            a.MouseDown += Annotation_OnMouseDown;
        else
            a.MouseDown -= Annotation_OnMouseDown;
    }

    foreach (Annotation a in ChartModel.Annotations)
        a.Unselect();
}

private void uiEditTextTextBox_OnKeyDown(object sender, EventArgs args)
{
    if (args.KeyCode != Keys.Enter)
        return;

    foreach (Annotation a in ChartModel.Annotations.Where(a => a.IsSelected()))
        ((TextualAnnotation) a).Text = ((ToolStripTextBox) sender).Text;

    ChartModel.InvalidatePlot(false);
}
lol keep in mind this is off the top of my head in Sublime Text, so there might be errors, but hopefully this gives you ideas! Also if you've got any tips, suggestions or corrections I'm all ears. Being wrong just means I can learn better ways of doing things =).

Edit; you could also make them update as the text is entered, looks kinda cool. I opted for the enter key over it in the demo though:
private void uiEditTextTextBox_OnTextChanged(object sender, EventArgs args) 
{
    foreach (Annotation a in ChartModel.Annotations.Where(a => a.IsSelected()))
        ((TextualAnnotation) a).Text = ((ToolStripTextBox) sender).Text;

    ChartModel.InvalidatePlot(false);
}
Also, no idea why the minus symbol is showing up weird in the actual post O_o not doing that in editing/preview.

Contour plot, fill color and logarithmic scale

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

nhrl wrote at 2013-09-19 16:42:

Hi everybody !

I'm using Oxyplot as a library for .Net framework 4.0, in VB Express 2010 environment.
I'm trying to make contour plots and my questions are the following.
  • Is it possible to have a logarithmic scale for the third axis ? If it is, what's the way to do it ?
  • Is it possible to fill the gap between contour levels ?
Thank you.

NHRL

objo wrote at 2013-09-20 09:10:

You can set the ContourLevels property of the ContourSeries.
Currently, it is not possible to fill the gap between the contour levels.
But you can add a HeatMapSeries before the ContourSeries - see the examples.
If you use a RangeColorAxis, I think you can get almost the same result.

nhrl wrote at 2013-09-20 10:41:

Thank you objo for you answer.
Indeed, I set the ContourLevels to {1,10,100,1000}, creating a logarithmic scale.

Concerning the HeatMapSeries, I did not managed to use it.
I have the following error :
La référence d'objet n'est pas définie à une instance d'objet.
with the following code :
Dim Plotmodel1 As New PlotModel
        Plotmodel1.Title = "Atlas de vagues - " & ComboBox1.SelectedItem
        Dim linearAxis1 As New LinearAxis()
        linearAxis1.Position = AxisPosition.Bottom
        linearAxis1.Title = "Tz (s)"
        linearAxis1.MajorGridlineStyle = LineStyle.Solid
        linearAxis1.MinorGridlineStyle = LineStyle.LongDash
        Plotmodel1.Axes.Add(linearAxis1)
        Dim linearAxis2 As New LinearAxis()
        linearAxis2.MajorGridlineStyle = LineStyle.Solid
        linearAxis2.MinorGridlineStyle = LineStyle.LongDash
        linearAxis2.Title = "Hs (m)"
        Plotmodel1.Axes.Add(linearAxis2)
        Dim contourSeries1 As New ContourSeries()
        Dim heatMapSeries1 As New HeatMapSeries()

        heatMapSeries1.X0 = tz_ss(0)
        heatMapSeries1.X1 = tz_ss(UBound(tz_ss, 1))
        heatMapSeries1.Y0 = hs_ss(0)
        heatMapSeries1.Y1 = hs_ss(UBound(hs_ss, 1))
        heatMapSeries1.Data = prob_ss

        contourSeries1.ColumnCoordinates = tz_ss
        contourSeries1.ContourLevels = {1, 10, 100, 1000, 10000}
        contourSeries1.LineStyle = LineStyle.Solid
        contourSeries1.StrokeThickness = 5

        contourSeries1.ContourColors = {OxyColors.Aquamarine, OxyColors.Aqua, OxyColors.CadetBlue, OxyColors.Blue, OxyColors.Black}
        contourSeries1.Data = prob_ss
        contourSeries1.RowCoordinates = hs_ss

        Plotmodel1.Series.Add(heatMapSeries1)
        Plotmodel1.Series.Add(contourSeries1)
        Plotmodel1.Background = OxyColors.White
        Plotmodel1.PlotAreaBackground = OxyColors.White


        Plot1.Model = Plotmodel1
If I add only the contourseries1 to the Plotmodel1, it works. But with the heatMapSeries1, it fails.

nhrl wrote at 2013-09-20 16:00:

In addition to my previous post, I can tell you that :
  • On my oxyplot version, the method "Add" doesn't exist for the "Data" method of "Heatmapseries"
  • The version of Oxyplot I use seems to be different of the one used for the exemple (?)
  • I cannot reproduce the simple examples of Heatmapseries that are provided in the examplebrowser..
Do you have any idea ?

nhrl wrote at 2013-10-01 10:45:

Does anybody have an idea ?

objo wrote at 2013-10-01 22:09:

Did you check the real source code for the examples? I see that the generated code is not correct for Array properties.
I added an issue on this: https://oxyplot.codeplex.com/workitem/10083
thanks!

objo wrote at 2013-10-01 22:51:

the issue with the arrays should now be fixed

nhrl wrote at 2013-10-02 13:35:

Hi objo.

Thank you for your answer. Unfortunately, it did not solve my problem.
Actually, I code in VB.net, not in C#.
I'm trying to translate the example code from C# to VB.net, but I have errors.
Particularly, I don't know how to translate this line :
heatMapSeries1.Data = new Double[100, 100];
And I think this line is important.

Do you have any idea ?


nhrl wrote at 2013-10-02 14:05:

Ok, the translation in VB.net should be :
heatmapseries1.Data = New Double(2, 2) {{1, 2, 3}, {3, 2, 1}, {1, 1, 1}}`
Now, here is my entire code :
Plotmodel1.Title = "Atlas de vagues - " & ComboBox1.SelectedItem
        Dim linearColorAxis1 As New LinearColorAxis()
        linearColorAxis1.HighColor = OxyColors.Gray
        linearColorAxis1.LowColor = OxyColors.Black
        linearColorAxis1.Position = AxisPosition.Right
        Plotmodel1.Axes.Add(linearColorAxis1)
        Dim linearAxis1 As New LinearAxis()
        linearAxis1.Position = AxisPosition.Bottom
        linearAxis1.Title = "Tz (s)"
        linearAxis1.MajorGridlineStyle = LineStyle.Solid
        linearAxis1.MinorGridlineStyle = LineStyle.LongDash
        linearAxis1.Position = AxisPosition.Bottom
        Plotmodel1.Axes.Add(linearAxis1)
        Dim linearAxis2 As New LinearAxis()
        linearAxis2.MajorGridlineStyle = LineStyle.Solid
        linearAxis2.MinorGridlineStyle = LineStyle.LongDash
        linearAxis2.Title = "Hs (m)"
        Plotmodel1.Axes.Add(linearAxis2)

        Plotmodel1.Background = OxyColors.White
        Plotmodel1.PlotAreaBackground = OxyColors.White

        Dim heatmapseries1 As New HeatMapSeries
        heatmapseries1.X0 = 0.5
        heatmapseries1.X1 = 10.5
        heatmapseries1.Y0 = 0.5
        heatmapseries1.Y1 = 15.5
        heatmapseries1.Data = New Double(2, 2) {{1, 2, 3}, {3, 2, 1}, {1, 1, 1}}

        Plotmodel1.Series.Add(heatmapseries1)

        Plot1.Model = Plotmodel1
But the error remain. Actually, visual studio doesn't return any error, but my plot is empty with the following text in red :
OxyPlot paint exception : La référence d'objet n'est pas définie à une instance d'objet.
in english :
OxyPlot paint exception : object reference not set to an instance of an object
Thank you again.

NHRL

nhrl wrote at 2013-10-08 10:52:

Does anybody have an idea ?

I find OxyPlot is a wonderful toolbox, but it's a pity that I can't use its full capabilities..

Plot disappear in demo (oxyplot-a53ac6bf18cf )

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

sharethl wrote at 2014-03-12 17:28:

OxyPlot WPF Example browser,

Open any plot, click "code" tab, and click "Plot" tab again, plot disappear,
This not only happens on demo, but also in avalondock.

in avalondock, it was able to show plot if window is floated. but now cannot show plot.

Thanks.

bradcarman wrote at 2014-03-12 17:59:

I see this problem too. I just updated to the latest version today 2014.1.245.1 and am experiencing odd behavior with the plot disappearing randomly when displayed with the tab control in WPF. In my application I have about 10 different tabs, each with a separate OxyPlot control. All the plots display fine, but at some random point as I'm clicking through the tabs, the plot will disappear, and once this happens, all the plots disappear, even if they have already been rendered previously.

sharethl wrote at 2014-03-12 19:07:

There is another I think related problem on previous version, oxyplot_8ef807c53c7f,
WPF demo browser's "Add annotations" in "Mouse event" group, once click "Code" tab, and back to plot tab, mouse event won't update plot while mouse moving.

reproduce:
  1. Run oxyPlot.WPF Example,
  2. Select "Add annotations" in "Mouse events" group.
  3. Click "Code" tab,
  4. Click "Plot" tab.
  5. Use mouse to draw arrow, the arrow won't update during mouse moving.
How should we debug this and contribute?

Thanks.

tibel wrote at 2014-03-12 19:43:

Issue is in Plot.cs:
line 777 should be removed, then it works ;-)

sharethl wrote at 2014-03-12 19:56:

Cool!
Such a big library really cannot find out why if not familiar with it.

Thanks

objo wrote at 2014-03-12 22:26:

I have checked in some changes, it seems to solve all these problems. I will try to get the NuGet packages updated (having some internet connection problems, will try to push over a mobile line)

tibel: the intention with currentlyAttachedModel was to keep track of the PlotModel that is currently attached to the Plot control. This can also be the internalModel that is used when Model is null. When the control is unloaded, the currentlyAttachedModel should be null. I added a currentModel property that can be used in the UpdateModel method. Or do you see better ways to solve this?

sharethl: I think the add annotations example is working again now :-) great to hear you would like to contribute! see http://oxyplot.org/doc/Contributions.html for more information

tibel wrote at 2014-03-13 07:32:

Look more complex to me, but it's ok.

Only one thing:
ActualModel property should also use currentModel instead of this.Model.

objo wrote at 2014-03-13 10:53:

thanks, I checked in a fix. Also see the unit tests. We should add similar tests for the Invalidate/Update functionality too.

Bar Series Drifting Upward

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

mkov wrote at 2014-01-21 02:33:

Hello,

I have a nice OxyPlot setup with bar series and category axis on a WinForm. The thing is those bars jump up after I minimize and restore my form. I traced this down to this line in Render() method in BarSeriesBase.cs:
                if (!this.IsStacked)
                {
  culprit ->     categoryAxis.BarOffset[categoryIndex] += actualBarWidth;
                }
I don't know why this code is needed as it keeps on incrementing BarOffset values with each Render call, but that doesn't always make a visual difference. Nevertheless, once commented out bars stay where I intended them to be. I can provide more context if required. If possible, I'd like to request a fix.

Thanks!
MK

objo wrote at 2014-01-25 22:56:

Thanks for the bug report! I see this is happening also in the examples in the Windows Forms Example Browser (it is working in WPF). I have added issue
https://oxyplot.codeplex.com/workitem/10120
(I don't have time to solve this myself at the moment)

Export to PDF not working

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

thomasdr wrote at 2013-10-24 20:07:

I am having a problem exporting plots to a PDF.
When I export, the tick marks and the data series are not output.
I ran the Export Examples from the newest OxyPlot (2013.2.106.1) they act the same way. Any suggestions?

thomasdr wrote at 2013-10-25 13:59:

Well, I think I found the problem. In PdfRenderContex there is this code segment:
        if (stroke.IsVisible() || thickness <= 0)
        {
            return;
        }
If I change that to
        if (!stroke.IsVisible() || thickness <= 0)
        {
            return;
        }
my plot lines draw.

objo wrote at 2013-10-25 22:29:

Thank you! I have submitted the fix.