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

LineSeries always visualize Y value

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

xeo wrote at 2014-07-22 12:35:

I can't find a way to have the Y axis value visible, it shows randon values, sometimes min and max, sometimes in between.
Image
I've tried to set minimin and maximun but no luck.
Any hint?
Thank you.

Slxe wrote at 2014-07-22 16:37:

I've actually proposed that this be implemented for axes in general here. If you require it immediately though it shouldn't be too hard to extend your own axis and override paint to always print out the value on the absolute min and max (using the InverseTransform to get the value, I think). This is about as far as I've thought out how to implement it though, if you create a solution please share =).

Side note: a simple fix would be to alter MajorStep and MinorStep, and ShowMinorStep, but that'll only make them more frequent, not always show on the min and max.

xeo wrote at 2014-07-23 02:20:

Yep good advice, I will try to override it.
Thanks for your help and I agree, your proposal should be implemented.

xeo wrote at 2014-07-23 10:59:

I actually came up with a different solutions but I am not sure if it works with any value:

First I calculate the Maximun and Minimun and set them in the axe, then I set the MajorStep = MAximun - Minimun.

It works only for integers but for me it's enough till your advice will be implemented.

EDIT: forget it, it's bullshit, it works randomly... sic...

Double click not working for Silverlight

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

heromyth wrote at 2011-08-11 05:42:

After the axis panning, double clicking the mouse right button can't restore it. The double-clicking works for WPF and Winform.

I'm not sure whether it is a bug.


objo wrote at 2011-08-14 20:01:

It seems like Silverlight only raises single click right button events! Left button double clicks are ok, but I don't get the OnMouseRightButtonDown events for right clicks. Does anyone know a solution to this? Could it be a problem related to the silverlight context menu (we 'disable' the context menu by setting e.Handled = true)?


heromyth wrote at 2011-08-26 05:31:

Clicking the right button three or more times can raise the Double-Click right button event. Clicking the left button once and then clicking the right button also raises the Double-Clicking event.


objo wrote at 2011-08-28 21:19:

thanks for clearing this up! I found also a third way: Alt+left button double click. I updated the table on the "Home" wiki page.

The mouse command bindings should be up for a review! I think it should be possible to define which mouse button (and modifier key) is assigned to each action (pan, zoom, track). 

XAML binding LineAnnotation

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

golden_jubilee wrote at 2014-05-23 00:09:

Hello,

it is easy to add a static LineAnnotation in XAML.
 <oxy:Plot.Annotations>
  <oxy:LineAnnotation Type="Vertical" X="10" Color="Red" />
</oxy:Plot.Annotations>
However, how to bind n LineAnnoations with X values created in the ViewModel?

DateTime Label Every Second

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

Adum_264 wrote at 2014-03-04 20:57:

Hi, I do not quite understand how the datetimeaxis works and I can not find any documentation, I've been playing with the IntervalType, IntervalLength , MajorStep properties and I quite do not understand how is it working, I want a label every second.
        PlotModel.Axes.Add(new OxyPlot.Axes.DateTimeAxis()
        {
            Position = AxisPosition.Bottom, 
            IsPanEnabled = false,
            IsZoomEnabled = false,
            StringFormat = "mm:ss",
            IntervalType = DateTimeIntervalType.Seconds?,
            IntervalLength = ??,,
            MajorStep = ??,
        });

ZIndex

Oystein Bjorke 10 year бұрын updated by Enrico Brugnatelli 8 year бұрын 1
This discussion was imported from CodePlex

vindex wrote at 2012-07-22 18:56:

Hi!

Thanks for adding IsVisible property, it's very useful when you have to render several series.

Can you include ZIndex too? It would be very useful to change the order in wich series are displayed, and add the possibility to add commands like "Send to back" or "Bring to front".

Opacity property also would be an improvement: sometimes IsVisible is not enough. For example, it changes the scale of the whole plot. 

 

 


objo wrote at 2012-08-09 00:01:

Annotations have a 'Layer' property - but the z-order depends on the order in the collection.

It should be easy to add a z-index property to the series, but it is not really needed, I think. You can sort the Series collection before refreshing the plot.

Opacity should already be supported by the Alpha value in the color definitions!


vindex wrote at 2012-09-02 12:11:

I followed your recomendation and it's working ok.

Now, my problem is the legend. In order to draw A over B, the collection must be ordered as {B,A}. And this order is displayed also in the legend, wich is wrong: A must be the first in the list, because is on the top.

Is it possible to reverse the legend?

 


objo wrote at 2012-09-02 17:43:

Try to set the LegendItemOrder property to Reverse!

Hi I wanted to know if oxyplot will work for the Windows Phone

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

doctorj wrote at 2013-11-20 13:42:

Hi,
I have been using oxyplot for Windows 8 store apps for Surface , I am porting some of my apps to the Windows 8 Phone.
Can oxyplot work on the Windows 8 phone , and if it does how do I go about installing it to use.
Thank you,
Jerry

objo wrote at 2013-11-20 20:51:

The core library targets Windows Phone 7 and higher, but there is currently not implemented a control for Windows Phone. It should probably not be very difficult :)

OxyPlot (NET40) doesn't start on Windows XP with Framework 4.0

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

funkerkat wrote at 2013-10-21 16:29:

Hi,
I use OxyPlot lib NET40 for WindowsForms. Project made in VS2012 targeting Framework 4.0. It executes normally on Windows 7, but on Windows XP (with Framework 4.0 installed) it doesn't start. When I deleted OxyPlot from my project, application starts normally on Windows XP. What is the matter and how to solve this problem?

objo wrote at 2013-10-21 19:28:

I think you need to install .NET 4.0.3 runtime update on XP to support the portable class library.
The alternative would be to build the OxyPlot core for .NET 4.0.

Two or more plots per Form?

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

goicox wrote at 2013-06-21 09:07:

Dear OxyPlotUsers

I have been experimenting with OxyPlot under vb.net and trying to reproduce few of the plots shown in the example list. While this has been alright, I was wondering how one could show more than one plot (say 3) per form? And also how to position each plot in the form?

Below is the code I have used to reproduce one of the examples:
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        InitializeComponent()

        Dim Plot As OxyPlot.WindowsForms.Plot = New OxyPlot.WindowsForms.Plot()
        Plot.Dock = DockStyle.Fill
        Plot.Model = New PlotModel("Peaks")

        Dim cs As ContourSeries = New ContourSeries()
        cs.ColumnCoordinates = ArrayHelper.CreateVector(-3, 3, 0.05)
        cs.RowCoordinates = ArrayHelper.CreateVector(-3.1, 3.1, 0.05)
        cs.ContourColors = {OxyColors.SeaGreen, OxyColors.RoyalBlue, OxyColors.IndianRed}
        cs.Data = peaks(cs.ColumnCoordinates, cs.RowCoordinates)
        Plot.Model.Series.Add(cs)

        Me.Controls.Add(Plot)

    End Sub

    Function peaks(ByVal xin() As Double, ByVal yin() As Double) As Double(,)

        Dim ni As Integer = xin.Length
        Dim nj As Integer = yin.Length
        Dim res(ni - 1, nj - 1), x, y As Double
        Dim k As Integer = 0

        For i As Integer = 0 To ni - 1
            x = xin(i)
            For j As Integer = 0 To nj - 1
                y = yin(j)

                res(i, j) = 3 * (1 - x) * (1 - x) * Math.Exp(-(x * x) - (y + 1) * (y + 1)) _
                       - 10 * (x / 5 - x * x * x - y * y * y * y * y) * Math.Exp(-x * x - y * y) _
                       - 1.0 / 3 * Math.Exp(-(x + 1) * (x + 1) - y * y)

                k = k + 1
            Next
        Next
        Return res

    End Function
Thank you in advance, Goicox

AngleAxis labels

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

Tasaq wrote at 2014-04-27 15:28:

I would like to have 0 degrees at the bottom of the polar plot (Example here, don't mind E and W). I've been playing with StartAngle and EndAgnle but I can't work this out. Is this even possible?

This is the code:
            var angleAxis = new AngleAxis();
            angleAxis.MajorStep = 45;
            angleAxis.Minimum = -180;
            angleAxis.Maximum = 180;
            angleAxis.MinorStep = 9;
            plotModel.Axes.Add(angleAxis);
Everything is almost ok with this, but 0 degrees are postion at left and 180 at right, I want 0 to be bottom and 180 top.

objo wrote at 2014-04-28 09:42:

It should be possible to set Minimum = 0, Maximum = 360, StartAngle = -90 and EndAngle = 270. Also see the new LabelFormatter property and the last example under "Polar plots" in the example browser.

Tasaq wrote at 2014-04-28 09:48:

I never thought about using minimum and maximum that way, now I understand how 'labeling' works. Thanks :)

TimeSpan over Occurrance

Oystein Bjorke 10 year бұрын 0
This discussion was imported from CodePlex

A7eex wrote at 2013-08-16 09:07:

Hey there,

I'm trying to find a way to make a Chart that shows Vertical Columns (ColumnSeries). But i need a TimeSpanAxis on the x-Axis and a linear int Axis on the y-Axis. How can i do that/ can i do that in any way?

I think i read that ColumnCharts don't support TimeSpan Axes.

Any support would be appreciated!

Alex

A7eex wrote at 2013-08-16 09:26:

I found this in earlier Discussions:
https://oxyplot.codeplex.com/discussions/361912

Did you improve this yet?

objo wrote at 2013-08-19 11:03:

No, ColumnSeries will only support CategoryAxis. We cannot know if your columns should be a year or a millisecond wide.. I suggest you use a RectangleSeries if you need to use a TimeSpanAxis.