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

Tracker, AreaChart and Heatmap

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

urm3l wrote at 2013-04-04 09:08:

Hi guys,

I just started out using OxyPlot and it works very well but it brought up some questions. Maybe you could help.

1) Is it possible to have the tracker right above the mouse and not on the closest point? That would probably smooth tracking through most plots.

2) Is it possible to have a little dot follow the line where the tracker would be and then on click show the tracker? So that the user always knows where the mouse is tracking the plot.

3) Is it possible to stop the lower plot of an areachart from being tracked? Its just a lower boundary in my case and not used for any data.

4) Is there a way to get a line chart with multiple colors like the heatmap. I would like to set thresholds and then have the line colored to show different heights right in the plot color.

Thanks in advance

Point Annotation

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

RezaShirazian wrote at 2014-05-22 19:08:

I would like to add point annotation. Right now I add scattered series to simulate the behavior but much rather use annotation since that's what it is.

I tried using rectangle annotation but the rectangle resizes as the user zooms in and out. I tried image annotation with a small rectangle, however that doesn't work since its color is static and cannot be changed during run time.

Is there an easy way of adding point annotation on a plot?

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

It is quite easy to create a new annotation class. See the implementation of the EllipseAnnotation! To draw a fixed size point, the width/height of the ellipse should not be transformed.

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

I'm starting to think extending the annotation class is the way to go as well. Thank you
Under review

Exception when touching tablet

Oystein Bjorke 10 year бұрын updated by anonymous 10 year бұрын 2
This discussion was imported from CodePlex

ge75el wrote at 2014-07-29 18:16:
I use the current Version of OxyPlot on a Windows 8.1 32 bit tablet. When I touch the Plot-Window I got a System.NullReferenceException():

with the following callstack
Oxy.Plot.Wpf.dll!OxyPlot.Wpf.PlotView.OnManipulationStarted()
PresentationCore.dll!System.Windows.UIElement.OnManipulationStartedThunk()
...

On a PC, my application works fine but there I did not have Touchscreen Events.

My application was designed for Desktop and does not use excplicitally Touch Events but if so, it should not Crash.

Regards,
Georg

ge75el wrote at 2014-08-08 09:16:
The is only there when using OxyPlot.dll and OxyPlot.Wpf.dll from download here. It is away when compiling this DLLs from sources with Visual Studio 2013.

objo wrote at 2014-08-08 10:35:
at what line are you getting the null ref exception?

ge75el wrote at 2014-08-08 12:36:
I only have this Information:

Problemsignatur:
Problemereignisname: CLR20r3
Problemsignatur 01: BDCViewer.exe
Problemsignatur 02: 1.1.0.0
Problemsignatur 03: 53e4a545
Problemsignatur 04: OxyPlot.Wpf
Problemsignatur 05: 2014.1.319.1
Problemsignatur 06: 53b1ce0a
Problemsignatur 07: 246
Problemsignatur 08: 29
Problemsignatur 09: System.NullReferenceException
Betriebsystemversion: 6.3.9600.2.0.0.768.101
Gebietsschema-ID: 1031
Zusatzinformation 1: 5861
Zusatzinformation 2: 5861822e1919d7c014bbb064c64908b2
Zusatzinformation 3: 4754
Zusatzinformation 4: 47547fafc9a3073a5bbe8e69322a8db5

I think, it is here:
public partial class PlotView
{
    /// <summary>
    /// Called when the <see cref="E:System.Windows.UIElement.ManipulationStarted" /> event occurs.
    /// </summary>
    /// <param name="e">The data for the event.</param>
    protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
    {
        base.OnManipulationStarted(e);
        if (e.Handled)
        {
            return;
        }

        e.Handled = this.Controller.HandleTouchStarted(this, e.ToTouchEventArgs(this));
    }
		

Wrong offset from y-axis

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

RobinSoenen wrote at 2014-05-21 17:38:

Dear All,

I'm trying to use oxyplot to render a chart with lineseries.
I have added multiple lineseries to the chart but I seem to be having problems with the rendering.
In the added image the orange line should only begin after a certain time (not when the blue line starts).

points are being added in the following way:
 lineSeries1.Points.Add(new DataPoint(Offset, double.Parse(valueString)));
Is there a reason for this behavior?

https://onedrive.live.com/redir?resid=48B06587F86038FF!671&authkey=!AJcenx-Usfl9MAE&ithint=folder%2c.png


thanks for the help,

kr,

Robin

Lineseries.Color bug, help

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

OverDriver wrote at 2014-07-24 03:20:

Hi all, thanks for the library!
I wanna keep the color patter of creating the new line while getting the color of the line plotted. But this: OxyPlot.WindowsForms.ConverterExtensions.ToColor(tmpLine.Color); code will always return same color value back.
Thanks a lot!
foreach (Plot plotItem in _plots)
            {
                var tmpLine = new LineSeries();
                tmpLine.Points.AddRange(plotItem._resampledPoints);
                tmpLine.StrokeThickness = plotItem._thickness;
                tmpLine.LineStyle = plotItem._style;
                if(_showLineTitle)
                    tmpLine.Title = plotItem._name;
                if (!(plotItem._color.Equals(System.Drawing.Color.White)))
                    tmpLine.Color = plotItem._color.ToOxyColor();
                plotItem._color = OxyPlot.WindowsForms.ConverterExtensions.ToColor(tmpLine.Color);
                model.Series.Add(tmpLine);
            }

Slxe wrote at 2014-07-24 15:11:

You're using extensions wrong, might want to look into them more =P. Try just doing
tmpLine.Color.ToColor();

OverDriver wrote at 2014-07-24 16:59:

Every time the tmpLine.Color will always give me {#00000001} while the actual color is not. I've tried changing my code to This:
foreach (Plot plotItem in _plots)
            {
                var tmpLine = new LineSeries();
                tmpLine.Points.AddRange(plotItem._resampledPoints);
                tmpLine.StrokeThickness = plotItem._thickness;
                tmpLine.LineStyle = plotItem._style;
                if (_showLineTitle)
                    tmpLine.Title = plotItem._name;
                if (!(plotItem._color.Equals(System.Drawing.Color.White)))
                    tmpLine.Color = plotItem._color.ToOxyColor();
                plotItem._color = tmpLine.Color.ToColor();

                model.Series.Add(tmpLine);
            }
Thanks so much!

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

That's because LineSeries.Color is actually initialized to OxyColors.Automatic if you don't define it yourself. This allows whatever you've set to PlotModel.DefaultColors to handle giving line series colours when they're visible. You can do something similar to PlotModel.DefaultColors = OxyPalettes.HueDistinct(20).Colors to change what it gives out for automatic colours. You'll have to set the colour of the line series yourself if you want something from LineSeries.Color.

OverDriver wrote at 2014-07-26 00:17:

This information is so helpful! Thanks so much!
You're always so helpful :)

Real time data and panning problem

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

Greg767 wrote at 2014-07-26 15:45:

Hi,

I am using the Xamarin iOS component and have two plots that get real time data and I have two small issues.
  1. When I synchronize the vertical axis of the two plots and when I move the Y axis on either plot, data just disappears from the other plot. When I synchronize the horizontal axis everything is ok.
    Synchro is done as per the WpfExamples (coupled axes demo). Is it a bug or vertical synchro is different from horizontal one?
  2. The real-time data auto-scrolls nicely the X and Y axis so that the last point is always visible, but when I pan the plot by touch and I let it go, auto-scrolling stops. How would I re-trigger auto-scrolling?
Thanks a lot!
Greg

Greg767 wrote at 2014-07-26 16:12:

Ok, for question 2 I've found a solution.
I am calling Reset() on both axis 2 seconds after panning stopped.
Question 1 is still up though!

Thanks!

Greg767 wrote at 2014-07-27 17:30:

In fact, real time data doesn't auto-scrolls by default. Its just fitting all data in the same window by modifying the X/Y axis interval.

Slxe wrote at 2014-07-28 16:38:

Yup there's no auto scrolling built into OxyPlot at all. Every time you add new data to the Points lists on series tied to Axes, and you call InvalidatePlot(true), OxyPlot will recalculate the DataMinimum and DataMaximum values. I implement autoscrolling by comparing the previous and current X data added and panning by that amount.

As for syncing multiple axes when panning or zooming, I posted how I'm handling it here. Might help you figure out how to handle it for your issue.

Greg767 wrote at 2014-07-28 20:29:

Thanks a lot for taking the time to answer!!
I will do as per your post and what you said here!
Thanks again!

Last axis label of line graph is missing.

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

krishnaramuu wrote at 2014-04-27 08:10:

When I plot a line series graph in winforms, the last label in the x-axis is getting missed. When panning is done then it appears otherwise its not being shown. Could you help us in resolving this issue.

objo wrote at 2014-04-28 08:50:

You did not mention what kind of axis you are using. Can you create an example that reproduces the problem? (create the example as in Source\Examples\ExampleLibrary\Issues\OpenIssues.cs, this will make it possible to debug on all platforms!)

DateTimeAxis with IntervalType == DateTimeIntervalType.Minutes

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

swiszcz wrote at 2013-05-06 10:33:

Hi,

I want to display measurement data, where measurements were made every full minute (60 seconds), so I'm using DateTimeAxis with IntervalType == DateTimeIntervalType.Minutes on X axis. I'm using DateTimeAxis.ToDouble() to calculate x-coordinate and I obtain correct point series.

However, I was expecting ticks on the X axis to appear every full minute, but the actual distance between ticks is one minute +- a few seconds (see Example screen capture.).

Is there a way to have tick's distance equal to exactly 1 minute?

Regards,
Maciek
    public static PlotModel DateTimeAxisExample()
    {
        var plotModel1 = new PlotModel();
        var linearAxis1 = new LinearAxis();
        linearAxis1.MinorGridlineStyle = LineStyle.Dot;
        plotModel1.Axes.Add(linearAxis1);

    var dateTimeAxis1 = new DateTimeAxis();
        dateTimeAxis1.IntervalType = DateTimeIntervalType.Minutes;
        dateTimeAxis1.EndPosition = 0;
        dateTimeAxis1.StartPosition = 1;
        dateTimeAxis1.StringFormat = "hh:mm:ss";
        plotModel1.Axes.Add(dateTimeAxis1);

        return plotModel1;
    }

objo wrote at 2013-05-06 11:10:

I think there is a bug in the DateTimeAxis. Maybe this is related to double precision accuracy. I am adding a new issue:
https://oxyplot.codeplex.com/workitem/10045

swiszcz wrote at 2013-05-07 14:58:

Hi,

I've found that, in this case, in class: OxyPlot.Axes.Axis, in method: protected static IList<double> CreateTickValues(double min, double max, double step). commenting line: x = x.RemoveNoise(); solves a problem.

Good code, and a good library, by the way.
Thanks!

objo wrote at 2013-06-08 11:57:

Thanks for the solution, I will keep this in mind when looking into the DateTimeAxis again! I think I need to add more tests before I remove the 'RemoveNoise' line.

raphay wrote at 2013-07-04 15:31:

Hi,
I have another similar problem, sometimes at the minute or seconde scale, some major ticks doesn't appears

Image

I use Nugget, so i wonder if the solution proposed by swiszcz is available in the lastest version.

Thank you for your answer, your work is awesome,

Regards

swiszcz wrote at 2013-07-04 15:45:

Hi Raphay,

Although commenting line: x = x.RemoveNoise(); solves a my problem, i have no idea how does it influence the rest of a code (and it may as it is in a base class). So I just made a private fork of OxyPlot.

Best regards

RefreshPlot slows down WPF

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

user78483 wrote at 2013-10-04 12:52:

If I do have a huge number of datapoints within my lineseries, my wpf application becomes really slow.

I implemented the taskdemo from the source. There the maxpoint values was set to 20000. If I increase that number to 50000, the wpf application is not useable anymore once the RefreshPlot is called from within an update task (for about 50000 points).

Is there a way to solve this or is there a maximum of points you should draw within the plot?

Cheers mike

everytimer wrote at 2013-10-04 16:10:


user78483 wrote at 2013-10-04 17:34:

This solution is not really clear to me as I am new to OxyPlot.

By drawing dashed lines instead of filled ones I could gain performance. Is this right?

What about this "BalancedLineDrawingThicknessLimit" property?

A little idea how to use it would be great.

Thanks in advance,

mike

objo wrote at 2013-10-06 19:35:

We did some recent improvements to the performance on WPF, but WPF's rendering core is still a bottleneck.
I think we can do more of the updates in a background thread to improve responsiveness on the UI thread, but I have not tested this yet.
See also performance tips on https://oxyplot.codeplex.com/wikipage?title=Performance

willmoore88 wrote at 2013-10-25 14:53:

objo wrote:
We did some recent improvements to the performance on WPF, but WPF's rendering core is still a bottleneck.
I think we can do more of the updates in a background thread to improve responsiveness on the UI thread, but I have not tested this yet.
See also performance tips on https://oxyplot.codeplex.com/wikipage?title=Performance
Currently, the Update(bool updateData) method in OxyPlot/PlotModel/PlotModel.cs, is all happening on the UI thread? I am using OxyPlot in WPF and after calling InvalidatePlot, at which point I am running in another thread, as soon as Invoke() with InvalidateArrange (or something like that) gets called, its moves back onto the UI thread for the actual update of the PlotModel. Have you any code which does this on a background thread? When I try and do it i'm running into errors because the plot object belongs to another thread.

This is really affecting the performance of my app and am going to have to fundamentally change the way I draw my graphs soon if I can not solve the issue. I already am using OxyPlot purely for the Axis and rendering the plot contents myself and using the Annotation series to show the bitmap I create.

willmoore88 wrote at 2013-10-25 16:36:

Your Examples are also the same. The demo 'Refresh by calling RefreshPlot on the PlotModel from a non-UI Thread' just calls refreshPlot in a separate thread, but all the updating gets pushed to the Main Thread...

willmoore88 wrote at 2013-10-28 10:18:

Is there nothing I can do about this objo?

willmoore88 wrote at 2013-11-11 10:28:

Any ideas of what could be moved to a background thread?

willmoore88 wrote at 2013-11-11 17:06:

I have moved the part of the Render function (I'm only concentrating on Scatter Series at the moment as that is all i'm using) which converts the points to screen co-ordinates successfully to another thread and this works. However, still the DrawMarkers functions are what is causing the freeze as they are writing directly to the canvas.

Do you think implementing a 'double canvas' where the entire canvas is drawn and then sent to the screen, rather than each point in turn? This would sort of be like a Windows Forms 'double buffer'?

objo wrote at 2013-11-11 19:34:

I tried to make a small prototype using a scheduler from the UI thread's synchronization context, but could not get around blocking the UI thread while populating the canvas. Try stack overflow, I am sure someone knows if this is possible or not!

Is it possible to get the actual x value in a BarSeries ToolTip

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

bass86 wrote at 2014-08-13 15:17:

Is it possible to get the actual x value in a BarSeries ToolTip by a MouseDown event?