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

Line Series Tracker in Android

Fernando García 10 year бұрын жаңартылды 10 year бұрын 2
Hi,

I'm rendering a LineSeries in Android (a Xamarin.PCL project), but the tracker is not working, no label is showed when I tap on the line series.

Is the tracker working in Android/iOS or it's not implemented?

Thanks.
0

Testing AppVeyor

Oystein Bjorke 11 year бұрын 0
I am testing AppVeyor. Hopefully it can build OxyPlot and push the NuGet packages!

How to include library in xaml/c++ project?

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

huge_newbie wrote at 2013-08-08 20:23:

First of all, I'm a structure engineer trying to fumble my way through programming. So, please forgive me if my question is stupid.

I have an xaml/c++ metro project. When I try to download library... here are a couple of screenshots.

https://dl.dropboxusercontent.com/u/34225393/ploterror1.png

https://dl.dropboxusercontent.com/u/34225393/ploterror.png

I'm trying to create a user control that plots equations. What do I need to do to make this work?

Again, many apologies.

everytimer wrote at 2013-08-08 20:38:

I'm not sure if OxyPlot is compatible with C++. But lets hear the experts' answers... Good luck

huge_newbie wrote at 2013-08-08 20:46:

everytimer wrote:
I'm not sure if OxyPlot is compatible with C++. But lets hear the experts' answers... Good luck
Why not? When I started learning how to program, every developer I talked to told me C++ was the way to go. Wasn't easy for me to learn enough of it to have a few apps published in the winstore, especially without any prior formal training. Did not know libraries existed until last night, so I'd been writing out everything myself in c++.

You saying I should learn another language? Which one?

Added by edit.

In fact, I still have no idea how to use a library after I installed it. People keep answering me with programmer lingo in one word or one sentence answers.

everytimer wrote at 2013-08-08 21:25:

I'm learning C#, and I think it's great. I'm developing an application that takes data from a vibration/acoustic test and then performs some processing. For that first I needed represent my data and OxyPlot is an awesome library for that task. I've tried previously with DDD (another library, but it has serious limitations).

When you download a .dll file from the Internet you may need unblock it. Right-click on the file --> properties --> Unblock.
Image

Personally I recommend you to learn C# + WPF (unless you had some experience in C++ and you don't have time). WPF stands for Windows Presentation Foundation, it provides you tools for creating rich interfaces without cracking your head in program the behavior of each UI element.

I don't know if Phyton suites better for engineering problems, I'll probably start learning it in future.
There is a huge site about programming questions/answers: http://stackoverflow.com/ almost every question that I could have is already answered there, and if its very particular you could ask and if the question makes sense get a answer in matter of minutes.

Good luck!

iOS OxyTouchEventArgs not in Default

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

benhysell wrote at 2014-03-06 01:09:

Pulled down default, opened the iOS example project, and couldn't compile. The iOS examples project couldn't find OxyTouchEventArgs. Not sure if these are omitted or not....just wanted to send a heads up.

objo wrote at 2014-03-06 07:42:

Sorry, I have mixed some code with fork 9625. Will merge soon! Then everything should work in both the iOS and Android controls.

benhysell wrote at 2014-03-06 13:06:

Awesome, and no worries, default still works and I can move forward by just commenting it out for now.

objo wrote at 2014-03-06 20:52:

this should be fixed now. Also see the changes on text drawing and dashed lines.
Let us know if there are more issues on the rendering side!

benhysell wrote at 2014-03-10 17:42:

Fixed, and the text does look great!

Tooltips for annotations

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

nicolasr75 wrote at 2013-04-23 16:39:

Hello all,

first of all: many thanks to the OxyPlot author(s). This is really great work !!!

My question:

in my plot I show a time series. For certain instants of time I show a vertical line annotation and additionally a rectangular annotation like a flag which contains a number. The number corresponds to an event and I would like to show additional information for the flag as a tooltip. Is it possible to show something like a tooltip when the mouse hovers over the annotation?

Thanks for any ideas.
Nicolas

justserega wrote at 2013-04-24 06:48:

I join to both: question and thanks to OxyPlot authors! (Best chart library for .net)

I have the same problem. Chart series with rectangle (annotation) corresponding time interval, tooltip is needed to show additional information.

May be you give clue on source code how to implement this functionality (I ready send patch if it would usefull)

objo wrote at 2013-04-24 11:16:

The tooltips should be easy to implement for WPF and Silverlight, but it may be more difficult on the other platforms. I have not decided whether to make solution where OxyPlot does most of the work related to the tooltips (hit testing) or if it should rely on the different implementations.
The original idea was to use IRenderContext.SetToolTip to set the tooltip on all following graphics elements. It is implemented for WPF in ShapesRenderContext.ApplyToolTip

nicolasr75 wrote at 2013-04-24 11:33:

Hello and thanks for the reply. I didn't expect that it is so easy :-) at least for WPF. I wrote my own Annotation class for other reasons anyway, so here is part of the class that shows setting the tooltip:
public class FlagAnnotation : Annotation
{
    ...

    public override void Render(IRenderContext rc, PlotModel model)
    {
        ...
        OxyPlot.Wpf.ShapesRenderContext src = rc as OxyPlot.Wpf.ShapesRenderContext;

        src.SetToolTip("This ist the tooltip");

        OxyRect rect = new OxyRect();
        ...
        
        rc.DrawRectangle(rect, OxyColors.LightBlue, OxyColors.Black);
        ...            
    }
}

debgz wrote at 2014-07-08 12:11:

Thanks for the Sample! I build myself a PointAnnotation with tooltips enabled out of that:

With default ShapesRenderContext tooltip text only applies to text and images.
   public class TooltipPointAnnotation : PointAnnotation {
        /// <summary>
        ///     gets or sets the tooltip text
        /// </summary>
        public string Tooltip { get; set; }

        public override void Render(IRenderContext rc, PlotModel model) {

            /*  get render context */
            ShapesRenderContext src = rc as ShapesRenderContext;

            /* set tooltip to render context if it exists */
            if (src != null) {
                src.SetToolTip(Tooltip);
            }

            /* draw elements the tooltip may apply to (text and images) */
            base.Render(rc, model);
        }
    }
Given the above I get a nice point annotation with an tooltip on the annotation text.

objo wrote at 2014-07-10 12:36:

I think the ToolTip property should be added to the PlotElement class and set when rendering all elements. Some refactoring should also be done - e.g. a new virtual Render method on the PlotElement class!
I have added https://oxyplot.codeplex.com/workitem/10230

Can't create a PlotModel

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

jessimb wrote at 2014-06-14 22:33:

The added or subtracted valued results in a unrepresentable DateTime.
That error gets thrown when I call
var Plot1 = new PlotModel();

Visual Studio points me to missing source code for PlotView.cs

Why is this all of a sudden happening?

Please help!!
Thanks in advance.
  public PlotModel makePlot(List<double> listNum, List<DateTime> times, List<double> listNum2, List<DateTime> times2)
        {
            var Plot1 = new PlotModel();
            Plot1.LegendSymbolLength = 24;
            Plot1.Title = "Two Lines";
            var objList = new List<Tuple<DateTime, double>>();
            

            for (int i = 0; i < listNum.Count; ++i)
            {
                objList.Add(new Tuple<DateTime, double>(times[i], listNum[i]));
                
            }
             

            // define an axis Date  
            var dateTimeAxis = new DateTimeAxis()
             {
                Position = AxisPosition.Bottom,
                IntervalType = DateTimeIntervalType.Milliseconds,
                StringFormat = "hh:mm:ss",
                TickStyle = TickStyle.Crossing,
                MajorGridlineStyle = LineStyle.Solid,
                MinorGridlineStyle = LineStyle.Dot
             };

            // Convert object client  to  DataPoint
            var points = objList.Select(obj => new DataPoint(DateTimeAxis.ToDouble(obj.Item1), obj.Item2)).ToList();

            // Create Line
            var linearSeries = new LineSeries()
             {
                 ItemsSource = points,
                 Color = OxyColor.FromRgb(0,0,0)
                 
             };
            //pred values
            for (int i = 0; i < listNum2.Count; ++i)
            {
                objList.Add(new Tuple<DateTime, double>(times2[i], listNum2[i]));

            }



            // Convert object client  to  DataPoint
            var points2 = objList.Select(obj => new DataPoint(DateTimeAxis.ToDouble(obj.Item1), obj.Item2)).ToList();

            // Create Line
            var linearSeries2 = new LineSeries()
            {
                ItemsSource = points2,
                Color = OxyColor.FromRgb(43, 255, 43)

            };
            var linearAxis = new LinearAxis()
            {
                MajorGridlineStyle = LineStyle.Solid,
                MinorGridlineStyle = LineStyle.Dot,
                Position = AxisPosition.Left,
                TickStyle = TickStyle.Crossing
            };

            Plot1.Axes.Add(dateTimeAxis);
            Plot1.Axes.Add(linearAxis);
            Plot1.Series.Add(linearSeries);
            Plot1.Series.Add(linearSeries2);

            return Plot1;
   

        }

jessimb wrote at 2014-06-15 05:59:

The problem was that I was trying to plot a null set.

Heatmap with mesh offset problem

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

michaeldjackson wrote at 2013-08-12 17:55:

Hey All,

I'm modeling fractures with OxyPlot. I've created a Heatmap using the Heatmap series and an overlay of the mesh using the LineSeries. However, the Heatmap is "offset" in the negative X direction (prior to Length of 0). In my dataset, all data starts at X coordinate of 0.

See this image:
https://skydrive.live.com/?mkt=en-US#cid=474829871261F415&id=474829871261F415%21135&v=3

Any ideas why or how to correct the problem.

Michael

everytimer wrote at 2013-08-13 20:13:

I have no idea why is this happening. Is the offset always the same? If so you can try to correct this offset by manually add that value to the initial X of your Heatmap. Good luck

P.D. Seems to be very interesting project to me, what is the purpose of the program?

michaeldjackson wrote at 2013-08-13 21:08:

I'll look into adding X offset. I'm guessing by doing that, I'll push the heatmap out beyond the mesh.

I work in the Petroleum Engineering Dept, research group, at University of Texas at Austin. This is a project to allow the industry to model, simulate and animate over time, underground fractures based on MANY (150 or so) inputs, fracturing fluids, time frames, etc. This is the culmination of a Ph.D. students 5 year research project. Using both 3D (helix3D toolkit) and 2D visuals.

It is interesting!

Michael

objo wrote at 2013-08-14 08:27:

The coordinates of the HeatMapSeries define the midpoints of the corner cells of the data array. I defined it this way so it should match the coordinates of the ContourSeries. I have added a small [2,3] example that demonstrates this.

I also corrected the calculation of the bounding box of the HeatMapSeries.

michaeldjackson wrote at 2013-08-15 14:31:

Thanks objo for the help.

I downloaded and referenced 2013.1.63.1 and tested. The heatmap offset still persists, and it is worse now than the previous version.

See this image for the increased offset problem:
https://skydrive.live.com/?mkt=en-US#cid=474829871261F415&id=474829871261F415%21136&v=3

Thanks,
Michael

objo wrote at 2013-08-15 16:36:

Yes, there should be a difference in offset in the latest version. I think the new version should be correct.
Did you adjust the X0, X1, Y0 and Y1 coordinates by half cell width/height?
See the new examples, I got exact match with the desired boundary of the heatmap.

geopars wrote at 2013-08-20 18:04:

Hi objo,
I also want to confirm that the problem with the offset still persists. The boundaries are now correct but the internal points are still shifted. Try a symmetric matrix and you will see that the diagonal is shifted.

Thanks,
George

objo wrote at 2013-08-22 21:37:

I added two 3x3 diagonal matrix examples (see the last example under HeatMapSeries and Custom series in the example browser). These seems to be correct. Can you provide an example where it is not working?

geopars wrote at 2013-08-23 10:28:

Hi objo,

Thanks for the quick reply. Check this example. image
You will see the the red line doesn't pass through the diagonal.
[Example("Diagonal matrix")]
public static PlotModel DiagonalMatrix()
{
   var data = new double[6, 6];
   data[0, 0] = 1;
   data[1, 1] = 1;
   data[2, 2] = 1;
   data[3, 3] = 1;
   data[4, 4] = 1;
   data[5, 5] = 1;

   var model = new PlotModel("Diagonal matrix");
   model.Axes.Add(new ColorAxis { Position = AxisPosition.Right, Palette = OxyPalettes.Jet(500), HighColor = OxyColors.Gray, LowColor = OxyColors.Black });

   // adding half cellwidth/cellheight to bounding box coordinates
   var hms = new HeatMapSeries { X0 = 0, X1 = 5, Y0 = 0, Y1 = 5, Data = data, Interpolate = true };
   model.Series.Add(hms);
   return model;
   }

objo wrote at 2013-08-28 00:19:

I have added this example (HeatMapSeries -> Diagonal matrix (6x6)) to the example library. It seems to render OK in the latest version. See http://oxyplot.org/examplebrowser/

geopars wrote at 2013-08-28 01:27:

I just saw the example that you posted on the example browser. That is correct. I just downloaded the latest source code. It is working on WPF and Silverlight but not on Winforms.

objo wrote at 2013-08-28 01:59:

Thanks, I didn't check winforms - see the latest update, should work now.

geopars wrote at 2013-08-28 02:28:

It is working correctly. Brilliant job objo. Actually I wanted to ask you, in the above example (DiagonalMatrix2). Even though we provide the limits X0 X1, Y0 and Y1, the image still shows coloring between -0.5 to 0 and 5 to 5.5. How is it possible to get rid of that in order to have an image that shows only the limits?

objo wrote at 2013-08-28 06:31:

I added a "CoordinateDefinition" property. Set it to "Edge" if you want to define the coordinates by the edges. I want to keep the default value to "Center", so the coordinates are defined the same way as for the contour series.
0
Under review

Export to PNG for Silverlight

Davide Sandonà 10 year бұрын updated by Oystein Bjorke 10 year бұрын 1
I'm using the Silverlight implementation of Oxyplot into a Windows Phone 8 app.
I was trying to save the plotview into a png image. Unfortunately i've seen the SaveBitmap method is not implemented. Is there any other way i could use to save the plot into a image?

Download Silverlight Example Browser for offline use

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

nickn3710 wrote at 2014-05-23 21:32:

Hi, Is there any way you could post the silverlight example browser online in such a way that I could download it and run it offline?

objo wrote at 2014-05-26 21:05:

What files do you need? I haven't tried this myself. If you use view source on http://oxyplot.org/ExampleBrowser/ you will find
http://oxyplot.org/ExampleBrowser/ExampleBrowser.xap
http://oxyplot.org/ExampleBrowser/Silverlight.js
http://oxyplot.org/ExampleBrowser/Index.html
I think this should be sufficient.
But the best way would probably be to clone the source code and build the Silverlight example browser yourself!

nickn3710 wrote at 2014-05-27 20:12:

Thank you. I downloaded those files and it worked.

I also downloaded the source code and tried to compile the ExampleBrowser. However, I kept getting errors indicating that my version of visual studio was insufficient. I am running Express 2012; is the professional version required to compile the ExampleBrowser?

VS Express 2013 Invalid Markup with OxyPlot

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

LucasR wrote at 2014-01-28 16:29:

I'm developing an application in VS Express 2013 using C#/XAML and referencing the pre-built OxyPlot binaries (Express doesn't support PCL). Everything works just fine, except when I add a plot to the XAML code. The Design window states there's an invalid markup, but the project compiles and runs just fine, with the charts working.

Here's the XAML code in question. The oxy:Plot controls are presenting a warning: "The name "Plot" does not exist in the namespace "http://oxyplot.codeplex.com"". Any idea how to fix this issue?
    <Window x:Class="Playback.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:oxy="http://oxyplot.codeplex.com"
        xmlns:local="clr-namespace:Playback"
        Title="Playback" Height="700" Width="1260" WindowStartupLocation="CenterScreen">
    <Window.DataContext>
        <local:MainViewModel />
    </Window.DataContext>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition Height="65"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="201*"/>
            <ColumnDefinition Width="425*"/>
        </Grid.ColumnDefinitions>
        <oxy:Plot Model="{Binding UpChart}" Margin="0,20,0,0" Grid.Column="0" Grid.Row="0"/>
        <oxy:Plot Model="{Binding MidChart}" Margin="0,20,0,0" Grid.Column="0" Grid.Row="1"/>
        <oxy:Plot Model="{Binding LowChart}" Margin="0,20,0,0" Grid.Column="0" Grid.Row="2"/>
    </Grid>
</Window>
Thank you!!

objo wrote at 2014-02-02 21:13:

Sorry, I don't know what is wrong here.
You could try to build a .NET 4 or 4.5 version of the core library (there is a .NET 3.5 project you can start from) and see if the errors disappear.