Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all 2061 articles
Browse latest View live

New Post: Is there a replacement for KeyboardPanHorizontalStep in XAML?

$
0
0
I am updating my graphs to use the newest version, and noticed that KeyboardPanHorizontalStep and KeyboardPanVerticalStep are no longer allowed in the plot definition in xaml, is there something else that allows the same functionality as these two commands.

New Post: Using a scrollbar ?!

$
0
0
Such a sample would be great.

Can this be done with an Annotaton?

New Post: something is not right on the hascode

$
0
0
Hi Objo,
While testing, I found an issue where i added a series into a dictionary as key and later retrieve it using the series as a key. Exception is thrown claiming no such key.

After some digging of this weird behaviour, i believe it comes down to the a new added gethashcode override method in PlotElememt.
public override int GetHashCode()
        {
            // Get the values of all properties in the object (this is slow, any better ideas?)
            var propertyValues = this.GetType().GetProperties().Select(pi => pi.GetValue(this, null));
            return propertyValues.GetHashCode();
        }
I can't tell whats wrong with this method of using reflection to retrieve properties value, but a simple test shows that this is not working.
LineSeries series = new LineSeries();
int hash1 = series.GetHashCode();
int hash2 = series.GetHashCode(); // different hash returned...
Any idea? thanks!

New Post: Change HitTest to public

$
0
0
Hi, Objo, Can you change HitTest in UIPlotElement from protected to public?

This way will made it possible to add mouse tool. like: annotation delete tool, re-size tool, etc..
see DeleteAnnotationMouseTool's OnMouseDown event.
// attach even in chrome, which extends plotmodel.this.MouseDown += OnMouseDown;
this.MouseMove += OnMouseMove;
this.MouseUp += OnMouseUp;
public MouseTool MouseTool{get;set;} // moues tool property.//-------------------------------------------// inside the chrome. and this mouse tool can be any tool people create.privatevoid OnMouseDown(object sender, OxyMouseDownEventArgs e) {
            if (_mouseTool != null) {
                _mouseTool.OnMouseDown(this, e);
            }
        }

//--------------------------------------------// example of delete mouse tool, click an annotation, remove it from annotations collection.publicclass DeleteAnnotationMouseTool : MouseTool {
     publicoverridevoid OnMouseDown(ChromeModel chrome, OxyMouseDownEventArgs e) {
        HitTestResult hitResult;
        ScreenPoint screenPoint = e.Position;
        
        foreach (Annotation a in chrome.Annotations) {
            // here needs HitTest. 
            hitResult = a.HitTest(screenPoint, HIT_TEST_TOLERANCE);
            if (hitResult != null) {
                // add to collection for later to delete.break;
            }
        }
        // delete annotation.
    }
}

New Post: Adding custom series to the main library

$
0
0
Hi,

I was wondering what is the politic behind adding new series types to the main library?

I have created a "ScatterWithErrorBarSeries" that I use in my code. It's heavily inspired by the "CustomSeries" example in the example library but with some added functionalities.

I would be willing to add it to the list of available series in the main code, but don't want to "force" it to the main code without asking first.

What are your opinions? Should the number of built-in series be kept low and leaving people to create their own custom series, or should people be welcome to add other series types so that people can contribute to them?

Source code checked in, #18ca685a7ecc

New Post: Adding custom series to the main library

$
0
0
Sounds great! It is difficult to define rules, but it should be a series/annotation/axis of general interest. I think the scatter with error bars series could fall within this category. Is it supported in other plotting libraries? Please create some examples showing how to use it and submit a pull request!

Source code checked in, #f5c347b74634

$
0
0
Add public UIPlotElement.HitTest (discussions/540394) Rename protected HitTest to HitTestOverride

New Post: Change HitTest to public

$
0
0
I agree on this. Done!
Note: I renamed the virtual method to HitTestOverride (following naming pattern from FrameworkElement.ArrangeOverride at MSDN)

New Post: Change HitTest to public

$
0
0
I hope I could push the mouse tool to source code that could help people.
But will mouse tool duplicate Manipulator? or duplicate "HandleMouseDown" in "PlotModel".

The idea will be like the following code, start from the 3rd line.
Will this be ok and compatible?
if so, I am going to fork it out and submit with different built-in mouse tools.
Public MouseTool MouseTool{get;set;} // include this property in PlotModel.publicvoid HandleMouseDown(object sender, OxyMouseDownEventArgs e)
        {
            // handle mouse tool first.// pass plotmodel instead of plotControl. so mouse tool could modify annotations collection or other plotmodel's properties.
            mouseTool.OnMouseDown(this, e)); 
            if(e.handled) return;
            
            // Revert the order to handle the top-level elements firstforeach (var element inthis.GetElements().Reverse())
            {
                var uiElement = element as UIPlotElement;
                if (uiElement == null)
                {
                    continue;
                }

                var result = uiElement.HitTest(e.Position, MouseHitTolerance);
                if (result != null)
                {
                    e.HitTestResult = result;
                    uiElement.OnMouseDown(sender, e);
                    if (e.Handled)
                    {
                        this.currentMouseEventElement = uiElement;
                    }
                }

                if (e.Handled)
                {
                    break;
                }
            }

            if (!e.Handled)
            {
                this.OnMouseDown(sender, e);
            }
        }

Commented Unassigned: DateTime axis value overlaped for large data. [10169]

$
0
0
Hi,

DateTime axis value overlapped for large data. Please refer attachment snapshot.

Please suggest solution for it.


Thanks...
Comments: On the Axis properties one needs to play around with the ```MajorStep``` and ```MinorStep``` properties till you have readable x-axis.

Commented Unassigned: iOS CoreText Off Center [10163]

$
0
0
The move to CoreText appears to have placed titles off center, see the attached screenshot...the title should line up nicely under the clock, but appears skewed.

![Image](http://i.imgur.com/wNtQWoL.png)



Comments: See example in branch [https://oxyplot.codeplex.com/SourceControl/network/forks/benhysell/CoreText](https://oxyplot.codeplex.com/SourceControl/network/forks/benhysell/CoreText). In the OxyPlot.XamarinIOS/ExampleLibrary/DateTimeAxisExamples.cs I modified the title on ```public static PlotModel DateTimeaxisPlotModel()``` to "Month". In the simulator, see the DateTime Axis/DateTime Axis example. ![Image](http://i.imgur.com/TAF1PaE.png) ![Image](http://i.imgur.com/prjC0oE.png)

Edited Unassigned: iOS CoreText Plot Title Off Center [10163]

$
0
0
The move to CoreText appears to have placed titles off center, see the attached screenshot...the title should line up nicely under the clock, but appears skewed.

![Image](http://i.imgur.com/wNtQWoL.png)



New Post: Adding custom series to the main library

$
0
0
Actually, error bars in a lot of charting frameworks are available for line, scatter and bar plots. If you look at PyChart implementation for example, you'll see that the error bar itself has its own "class" and has different visualization possible. For example, it can show simple bars, just the min/max, or display quartile and min/max.

The implementation I made is way simpler for now, I just displays the error bar in the form of min/max representation.

I created a pull request for it.

One question though, I see that I didn't set my username on the commits I made... I have "Xavier" as username instead of Gimly. Is there an option to change this now that the commits are pushed? It's actually the same for the other pull requests I made earlier. It's a bit annoying since the commits are not linked to my username, but if it's too complicated to change, it's no big deal.

I know that GitHub deals with this very easily, but don't know about Codeplex.

Cheers.

Created Unassigned: incorrect and missing points rendered from LineSeries [10170]

$
0
0
In RederingExtensions the:
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped

In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list

I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_

I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.

New Post: Handling massive series

$
0
0
We were using MVVM to handle series containing up to a couple million points and experienced a serious bottleneck (took over a couple minutes to render and crashed on resize due to out of memory exception). The main problems were that there were too many screen points trying to be rendered, the garbage collector was being stressed too much, and the plot model was recreated upon each render. I was able to do the following:
  • prevented boxing of data and screen points
  • added ability to decimate
  • added ability to append without re-rendering each series via a safe INotifyCollectionChanged supporting bulk addition
  • allows binding directly to data if using IList<IDataPoint>
  • avoids reflection and accessor functions when iterating through source data points
  • avoids unnecessary recalculation of max-mins
  • avoids redundant calculations in valid values
  • reuses intermediate memory for rendering (to avoid stressing 3rd generational memory)
  • avoids recreating model upon each render for MVVM
  • I'm sure there's more
I did all this via inheritance, so we could live happily along side your library. However, much of this would make more sense to be added to the original source. The decimation & data appendage might make sense to leave inside a derived LineSeries, though, since they depend on monotonic x values (automatically detected of course). This done in the PCL & I only have the WPF wrappers implemented.

Would you be interested in pulling some of this in?

Commented Unassigned: incorrect and missing points rendered from LineSeries [10170]

$
0
0
In RederingExtensions the:
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped

In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list

I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_

I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: This sounds great. I will review soon. Is it ok to add LECO to the CONTRIBUTORS file and change to the standard header (copyright by OxyPlot contributors)

New Post: Handling massive series

$
0
0
Yes, this is very interesting! Can you create a fork and submit each change separately? This will make it easier to review the changes.

Have you checked if the following changes could have a performance improvement
  • not performing the actual clipping, but depending on the rendering capability of the output device
  • clipping in a parallel loop

Source code checked in, #876acefbfdb1

$
0
0
#10170 Improve performance of DrawClippedLine (add outputBuffer, inlining)

Source code checked in, #6952c424c42a

$
0
0
Add PerformanceTest application (used for profiling)
Viewing all 2061 articles
Browse latest View live


Latest Images