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

WPF version mouse down cannot fire if invalidatePlot in PlotModel.MouseMove

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

sharethl wrote at 2014-08-07 16:41:

The following code will make PlotView's OnMouseDown cannot fire.

The reason could be the invalidate plot function makes PlotView too busy on drawing itself.

Result is:
Cannot make an annotation following mouse cursor and do the mouse down even at the same time.

Possible solution:
Use something like tracker, which doesn't call InvalidatePlot.
plotModel.MouseMove += (s, e) => {
    //lineAnnotation.X = lineAnnotation.InverseTransform(e.Position).X;
    plotModel.InvalidatePlot(false);
};
How to duplicate:
  1. Open WPF Example browser.
  2. Open "Clicking on an annotation"
  3. Add the top code to it.
  4. Monitor PlotView's OnMouseDown.

Unable to open ExampleBrowser.exe

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

faroskalin wrote at 2013-12-03 15:41:

From my understanding, Example Browser is what allows users to get a basic understanding of what OxyPlot can do and get code samples. However, I am unable to open either the online one nor the ExampleBrowser.exe

Image

Image

I have Silverlight installed, and I don't think it is my firewall that is blocking access to that domain (does ExampleBrowser.exe use Silverlight/internet to access the code samples)?

Anyone have this issue? Thank you.

objo wrote at 2013-12-03 20:43:

Thanks for the notice. I think the output of the GTK# ExampleBrowser has been written to the wrong folder (replacing the NET 4.5 Windows Forms ExampleBrowser). I will correct this. Try the NET 4.0 Windows Forms ExampleBrowser.
The online example browser is based on Silverlight 4 and seems to be ok here. Is something wrong with the configuration?

faroskalin wrote at 2013-12-04 19:49:

Looks like the NET 4 version works. Are there any major differences/discrepancies between 4 and 4.5? Thanks objo.

objo wrote at 2013-12-04 19:54:

No, there should be no differences between the .NET 4 and .NET 4.5 versions.

Remove a specific series from Legend

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

RezaShirazian wrote at 2014-05-22 20:06:

What would be the easiest way of removing a series from a plot's legend but keep it on the plot?

objo wrote at 2014-05-23 08:11:

Try not setting the Title of the series. When it is null it will not be shown.

RezaShirazian wrote at 2014-05-23 17:56:

Thank you!

Live data?

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

dominikjeske wrote at 2014-04-30 22:48:

Is there any sample that shows working with live data? I have data from external device and I'm looking for chart library that shows changes in that data.
0

ETA on production (non pre-release) NuGet package for Xamarin.Android?

William Raiford vor 9 Jahren 0
Is there an ETA on when you would be able to create a NuGet package that is not in pre-release?
0

Full source code of the browser example

Samuel Guedon vor 10 Jahren aktualisiert vor 9 Jahren 1
How can I get the full source code of each (or a selection) of examples from the browser page (here: http://resources.oxyplot.org/examplebrowser/).


For instance, on the "Candles + Volume (combined volume), adjusting Y-axis" the Y-axis is auto adjusted when panning, but there is not a line of code in the code tab that does it.
Same for example that requires a mouse click, the piece of code that is call when the event is triggered (an also how the event is triggered) is not accessible.


This would massively help me as the examples are quite complete.

Customizing the selected area annotation

Oystein Bjorke vor 10 Jahren 0
This discussion was imported from CodePlex

oriches wrote at 2014-06-11 12:49:

I'm using the WPF version and I want to be able to customize (color and border) of the resize annotation which is displayed when I hold down the mouse button and drag over an area in the plot.

Is this possible, and if so is there an example for it?

thanks

Ollie.
0
Wird überprüft

Many images in Documentation->Series section are broken. Code examples are too brief there.

andrew vor 10 Jahren aktualisiert vor 10 Jahren 2
0

How to add dragable ArrowAnnotation like example

A W. vor 9 Jahren 0

By clicking a button I want to allow dragable arrow annotations in my plot including some data as text annotation . But I can't reach like in the example browser.

0
Wird überprüft

Possible memory leak issue

ChrisM vor 9 Jahren aktualisiert von David Gillard vor 6 Jahren 2

I am building a Xamarin.Forms app that needs to plot several graphs that update with new data every second. I've found Oxyplot to be a good library to use, but I've encountered memory issues. To see if the problem was being caused by Oxyplot and not somewhere else in the code, I created a simple Xamarin.Forms app that has a single line series to which a new data point is added every second and ran it through the Xamarin Profiler.


What I find is that the memory usage continues to slowly but steadily grow over time. According to the profiler, there are a number of System.Collections.Generic.Dictionary.Entry<System.IntPtr,System.Collections.Generic.List<System.WeakReference>>[] which continue to grow in size over time. With every call to InvalidatePlot(true), the memory usage increases.


I've included the code here, it's just about the most simple example of what I need the graph to do in my actual application.

namespace SimpleGraph{
    public class MyPage : ContentPage
    {
        PlotModel myPlotModel = new PlotModel ();
        PlotView myPlotView = new PlotView(){
            VerticalOptions = LayoutOptions.Fill,
            HorizontalOptions = LayoutOptions.Fill,
        };
        public MyPage ()
        {
            int ctr = 3;
            myPlotView.Model = myPlotModel;
            Content = myPlotView;
            SetupGraphs ();
            Device.StartTimer (new TimeSpan (0, 0, 0, 1), () => {        
                Random r = new Random ();
                ctr++;
                UpdateGraphs(ctr);
                myPlotView.Model.InvalidatePlot(true);
                return true;
            });
        }
            
        public void SetupGraphs()
        {
            Random r = new Random ();
            myPlotModel.Axes.Add (new LinearAxis { Position = AxisPosition.Bottom });
            myPlotModel.Axes.Add (new LinearAxis { Position = AxisPosition.Left, Maximum = 10, Minimum = 0 });


            LineSeries series1 = new LineSeries {
                MarkerType = MarkerType.Circle,
                MarkerSize = 4,
                MarkerStroke = OxyColors.White
            };
            series1.Points.Add (new DataPoint (0.0, r.Next(0, 10)));
            series1.Points.Add (new DataPoint (1.4, r.Next(0, 10)));
            series1.Points.Add (new DataPoint (2.0, r.Next(0, 10)));


            myPlotModel.Series.Add (series1); 
        }


        public void UpdateGraphs(int ctr)
        {
            Random r = new Random ();


            DataPoint dp = new DataPoint(ctr, r.Next (0, 10));
            LineSeries series1 = myPlotModel.Series [0] as LineSeries;
            series1.Points.Add (dp);
            if (series1.Points.Count > 30) {
                series1.Points.RemoveAt (0);
            }
        }
    }
}

Just to make things more interesting, the issue only occurs when using Android 5 or above.


I am new to mobile development, so I apologize if I've done something stupid, or am just using OxyPlot incorrectly.


I am using version 1.0.0-unstable1957 of Oxyplot.


Any assistance would be greatly appreciated.