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

WPF ContextMenu for Markers of LineSeries and ScatterSeries

Alexander Müller 8 years ago 0

Hi, Im trying to create a ContextMenu for markers of LineSeries and ScatterSeries.
Due there's no build in option, Im trying to get the current clicked (or nearest) clicked marker of multiple series inside the Plot.
I refered to the MouseEventExample, but I don't know how to transform the mouse position in WPF, because there are many methods that have been used in the example missing.
Any Ideas?

For more information here, refer to my question on StackOverflow:

http://stackoverflow.com/questions/33873750/oxyplot-contextmenu-for-markers-in-wpf

Building OxyPlot for WP8

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

PatrykCwiek wrote at 2013-04-08 15:41:

Hello everyone,

I have managed to get OxyPlot working on WP8, but there's a strange issue I'm experiencing when trying to set up a project to build one DLL.

If I include the OxyPlot (core) and OxyPlot.Silverlight_SL4 projects, then reference them both from WP8 project, I get fully working plots out of the box, even though Visual Studio complains that I'm referencing a Silverlight project which might not work properly . You can't include SL5 version - "The reference must be a Windows Phone project that targets the current or earlier version of the Windows Phone OS".

Now I can move the sources to WP8 project and build it - everything goes smoothly, it just works on the build stage. But then when I try to use this particular project in a WP8 app, I get blank screens - plots don't get rendered at all, I tried fiddling with various options to no avail.

Now, I have no idea why the exact same code works when it's in a SL4 project, but doesn't when in WP8 project, so I'd appreciate any thoughts.

If it's (relatively) easy to fix, I could just create a fork with the WP8 project and submit a pull request later on...

Change Current DrawingContext to one using OpenGL

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

sunwayking wrote at 2014-07-12 14:01:

Last year I tried to make a BitmapDrawingContext using WriteableBitmap. It brought lots of Performance improvement to my project. Err, I put a lot of effort to let WriteableBitmap draw text with transforms on WPF. Maybe there's many improvements needed to be done in BitmapDrawingContext, It works quite for me yet. One thing I should point out that the performance bottleneck of BitmapDrawingContext is DrawText, and there's no solution for it.
Recently, I had a try on OpenGL and soon fell in love with it:)
Why I finally choose OpenGL? Here're some reasons.
*Best performance!Hardware acceleration!
*cross platform: Windows, Unix, Linux, Mac OS,Andorid,WP....
*supporting .net on all platform with the help with Mono project, but only window support WPF.
*More Low-Level APIs which are easy to use.

To use OpenGL cross platform, I recommend OpenTK(Open Toolkit). The Open Toolkit is an advanced, low-level C# library that wraps OpenGL, OpenCL and OpenAL. There's another outstanding OpenGL library on .net framework whose name is SharpGL. However SharpGL just supports Windows while OpenTK supports all.

To make a new DrawingContext is not easy, I think it's necessary to give some changes to PlotView in order to maintain compatibility with existing DrawingContexts. So do you agree with me, objo?

In the end, BitmapDrawingContext is available for you all:
Supporting directly downloading with IE:
Download OxyPlot.Wpf.Extension (for WPF only)

Programatically (or via XAML) Define color for each bar in ColumnSeries

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

jg11 wrote at 2014-04-30 20:30:

I'm really enjoying the OxyPlot library. Thank you!

I have a Plot with seven ColumnSeries. I need to set each bar color (in each of the series) based on a property in the model.

From the code, I tried defining a list of colors in DefaultColors the chart is drawn where all the bars in the 1st series are drawn with DefaultColor[0] and all the bars in the 2nd series are drawn with DefaultColors[1], etc.
        eg: plotModel.Series.Add(new ColumnSeries { Title = "V1", ItemsSource = CellList, ValueField = "CellVoltage" });
               OxyColor defaultColor = OxyColor.Parse("#FF000080"); // Default -- blue
               plotModel.DefaultColors.Add(defaultColor);
               ...
From XAML, I tried to set FillColor binding to a method that should return a bar color, but it appears to return the same color for all bars in the series.
 eg: <oxy:ColumnSeries Title="V1" ItemsSource="{Binding Path=CellList}" ValueField="Voltage"  FillColor="{Binding Path=CellBarColor}" />


Thank you for your help
jg
Under review

Moving the project to GitHub

Oystein Bjorke 10 years ago updated by Nick Donais 10 years ago 3
This discussion was imported from CodePlex

objo wrote at 2014-06-14 08:52:
I am considering moving the project to GitHub. What do you think?

a5r wrote at 2014-06-16 09:27:
Nope, I like your projects on codeplex better :)

everytimer wrote at 2014-06-16 23:49:
I enjoy Codeplex too, but of course, it is your decision.

Slxe wrote at 2014-06-18 18:17:
I'm all in favour, as I like the layout of github more and it has a really nice wiki feature (can be used as documentation and in-project discussions/ideas area). Although I guess I'm a bit bias since I use and prefer it myself (lol if you hadn't already guessed by me linking my stuff on it).

Slxe wrote at 2014-06-20 16:25:
Oh, forgot to add, you can also set up a github,io (https://pages.github.com/) page with a github account, and using tools like Jekyll you can pretty easily manage it with just Markdown or reStructuredText files. (some examples: https://fsharp.github.io/FsCheck/ or http://yabatadesign.github.io/afterglow-theme/. A co-worker has been trying to push me into blogging on my own page also lol.)

objo wrote at 2014-06-26 09:27:
Yes, the wiki feature is great. The issue tracker and pull request management are also reasons why I would like to change!

See also the Google trends
github/codeplex/bitbucket/google code
hg/git

Slxe wrote at 2014-06-26 19:03:
I think the only downside is that there's no discussion board like there is here, so you'd have to make your own (as far as I know). Can't think of any other reason not to switch.

objo wrote at 2014-06-27 13:23:
Yes, the discussion forum is missing.
But is there a reason why GitHub has not included this?
Is stack overflow an alternative for questions on how to use the library, and then use the issue tracker to discuss defects and new features?

http://programmers.stackexchange.com/questions/87049/how-come-many-project-hosting-sites-doesnt-have-a-forum-feature
http://discuss.atom.io/t/why-discourse-instead-of-github-issues/3986

Slxe wrote at 2014-06-27 18:51:
Yea using Discourse sounds like a good option, and seems pretty easy to set up. Was also going to suggest google groups if that doesn't work as needed.

Gimly wrote at 2014-06-30 16:19:
The forum is really the one thing I miss comparing codeplex to GitHub. StackOverflow is not as good as it used to be in terms of answering questions, especially when you have relatively specific library-oriented questions.

Some projects like to use the issue tracker for asking question, but I find it gets crowded quickly and you end up having hard time trying to sort bugs/features requests and questions.

Slxe wrote at 2014-07-02 17:07:
Agreed, it'd be nice if github implemented some kind of simple message board, using the issue tracker for questions just makes it an absolute mess. Having an Oxyplot discourse board seems like a good idea, their sandbox looks good enough, although it doesn't look like it's free? ... Bah it's a Rails app though >_> much prefer django/flask stuff myself, this is kinda what stopped me from setting up Jekyll too lol, don't really want to touch Ruby...

Hmm looks like you can use Pelican to setup github.io pages (link1 link2 link3) and use reStructuedText (or 3 other markups). Now I don't have an excuse anymore lol.

Slxe wrote at 2014-07-11 16:52:
IMHO just go create a mock up github repository and github.io page, and play around with it, then decide if you like it over codeplex. No harm in giving it a try right?

objo wrote at 2014-07-11 22:15:
Yes, I will do some testing later!
The main reason for changing would be to make it easier to collaborate and manage contributions. It would be interesting to know if changing to GitHub would make more people interested in contributing to the project!
But the lack of discussion forum + loosing issue and discussion history + the work of moving 157 issues could be reason enough to stay with CodePlex...

Slxe wrote at 2014-07-16 18:41:
Been seeing Discourse being used more lately, the most recent example being Rust moving to using it (http://discuss.rust-lang.org/). Seems pretty nice and simple overall.

fedcba wrote at 2014-08-04 11:19:
Hi,

I would be more interested in contributing to the project. GitHub is a site with more focus on developers who want to help coding OxyPlot while CodePlex seems to have more focus on the discussions. I find more information on StackOverflow than on CodePlex when i have some problems, so i mostly don't use CodePlex. And when i have some bugs i would rather find the OxyPlot code and fix it on GitHub than on CodePlex because it's more clear and easier for me.
An example: I got an NullReferenceException on OxyPlot/Series/XYAxisSeries.cs: Line 181. I search in CodePlex, find the file but it does not show any lines. So i have to count the lines to get line 181?!

I agree with the forum problem: it would be better if there is a discussion site like on CodePlex. I would suggest a simple forum with phpBB or vBulletin. For discussions but also for wishes, problems, future versions, examples, download versions, etc.

PS: Notice, that there is no download button in GitHub for end user downloads. These must be provided by the discussion site or project site.

objo wrote at 2014-08-08 15:23:
what about userecho? Can that be used as a forum? http://oxyplot.userecho.com/

I will do some testing with github next week, I have created
https://github.com/objorke/oxyplot
and pushed the history from the codeplex repository (with kiln).

I will try to transfer the issues from codeplex to https://github.com/objorke/oxyplot/issues
Is it possible to automate this? Or can someone help transferring manually?

I also created
http://objorke.github.io/oxyplot/
It will be interesting to see if this can replace the content of http://oxyplot.org (which means the content of ~/Documentation and ~/Web should be moved and the folders can be removed from the repository)

Note: Codeplex is still the official location for discussions, issues and code.

Slxe wrote at 2014-08-08 16:09:
Never heard of userecho myself, from the main site it sounds nice, but the one you linked looked horrible lol could just be because it's not set up at all.

I'd be happy to help out moving the issues over on the weekend if you want to coordinate it somehow, also found this: Codeplex Issue Importer. Depending on what you're using to generate the github.io page it should be pretty simple to rewrite it in Markdown or reStructuredText and make it look nice, I've seen quite a few nice ones to use as an example out there.

Also, again, welcome back Objo! No clue where you went, but it's nice to see you active again =).

objo wrote at 2014-08-10 08:33:
@Slxe: thanks for the link! I tried both that one and cp2gh but could not get them to work. So I rather reinvented the wheel based on octokit. The project is 68 lines of C# code.

Here is a test repository with imported issues:
https://github.com/objorke/oxyplot-issueimport-test/issues

note:
  • not including closed issues
  • attachments are not included

objo wrote at 2014-08-15 00:00:
I have also tested migration of the discussion threads to UserEcho:
https://oxyplot.userecho.com/topic/489030-oxyplot-moving-the-project-to-github/

objo wrote at 2014-08-15 00:07:
@slxe: thanks for the welcome back. I just enjoyed an offline vacation with wife and children, I am not abandoning the project in case you were worried about that :-)

objo wrote at 2014-08-15 00:23:
I have created a GitHub organization https://github.com/oxyplot
The new repository is at https://github.com/oxyplot/oxyplot
It seems like also some of the committers are recognized at GitHub!

fedcba wrote at 2014-08-15 13:24:
I like the UserEcho site. Especially the FAQ at the beginning. It is also nice that you can sign in with your github account. I'm just curious about the grey boxes behind the text... Is that the information about non-readed posts or just the number of entries in the section?

I guess there are only a few things left, that maybe needed:
  • a download button/section for the binaries
  • maybe one more hint about the license (in FAQ section?)

wpf CanTrackerInterpolatePoints

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

ChevyCP wrote at 2012-01-30 16:08:

Hi,

  Would it be possible to expose the "CanTrackerInterpolatePoints" property in xaml for the line series?  It would just be a lot easier than getting at it in code.  Just a suggestion.

Thanks!


objo wrote at 2012-01-30 19:47:

try the latest version, change set 74462.


ChevyCP wrote at 2012-01-30 20:17:

Awesome!  Thanks!

Multiple LineSeries Binding

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

everytimer wrote at 2013-06-19 20:39:

Is it possible to bind a plot to a collection of LineSeries instead of a single LineSeries? (and not through the Model).

I'm looking for something like this:
   <oxy:Plot>        
        <oxy:Plot.Series>     
            <oxy:LineSeries ItemsSource="{Binding myCollectionOfLineSeries}" />              
        </oxy:Plot.Series>
    </oxy:Plot>

Where myCollectionOfLineSeries is:

private ObservableCollection<LineSeries> _myCollectionOfLineSeries ;
        public ObservableCollection<LineSeries> myCollectionOfLineSeries 
        {
            get
            {
                return _myCollectionOfLineSeries ;
            }
            set
            {
                _myCollectionOfLineSeries = value;
                OnPropertyChanged("myCollectionOfLineSeries ");

            }
        }

objo wrote at 2013-06-19 20:49:

No, this is not possible. You need one LineSeries for each line you want to show.
Create a PlotModel and bind the Model property or use code-behind to manipulate the Series collection more dynamically.
I am sure there are also other ways to do it in XAML only (maybe using an attached property??)

everytimer wrote at 2013-06-19 21:17:

Thanks for the quick answer. Someone suggested me a solution in StackOverflow but obviously it doesn't work:

http://stackoverflow.com/questions/17198926/multiple-lineseries-binding-in-oxyplot/17199040?noredirect=1#comment24910980_17199040

I'll try to do it trough the PlotModel.

DJDAS wrote at 2013-06-20 14:59:

Hi,
I had a similar situation some months ago when I needed to "bind" a plot to a custom class which had a set of data representing plot series (mainly StairStepSeries and AreaSeries).
My solution was quite simple: I created a viewmodel which contains one property for each series (List<DataPoint>), binding (in XAML) one OxyPlot series to the corresponding property (the only limitation here is that the series are statically added in XAML but it was ok for my purposes).
To fill in the values I used a simple "SetData" method in my model with my custom class as parameter, the method assigns each "class series" to the corresponding viewmodel property and fills the series using Points.Add(DateTimeAxis.CreateDataPoint(...)) calls.
Hoping to be helpful :)
Bye!

everytimer wrote at 2013-06-20 21:57:

Thanks, I've managed doing that by creating an ObservableCollection<LineSeries> and then with a foreach loop I update when it's needed. (I can't do the same as you because I don't know how many Series there will be: the user will be reading a file and he must be able to "add" any number of lines to the plot for comparing them).

DJDAS wrote at 2013-06-21 09:50:

Then maybe you should bind directly the Series property of the Plot (I don't remember if this is possible) to your collection or, as objo stated, you can assign your ObservableCollection<LineSeries> to the Series property of the PlotModel in code behind and bind the PlotModel to the Plot in XAML (or at last do everything in code).
Bye :)

everytimer wrote at 2013-06-21 15:32:

That's exactly what I was asking, and as objo said it's not possible right now to bind "Series" to a collection of LineSeries.
0
Under review

Customize position of labels in Polar chart

SamOxyPlot 10 years ago updated by anonymous 10 years ago 4
Hi

It is possible to change the position of the labels? I've marked in green where it should be located.

Image 4

DateTime Axis with label dates not 1 January each year

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

kirbatious wrote at 2014-07-02 16:07:

I am creating long-term forward-looking graphs at future dates e.g. with the data points being annually from 30 June 2014 for the next 20 years, and the DateTime axis always defaults to showing me 1 Januaries on the x axis.

Is there any way to specify that the x axis labels should instead be every 30 June (or indeed any other date in the year)?

AngleAxis.StartAngle in WPF

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

ScottyDoesKnow wrote at 2014-04-17 19:45:

I'm graphing a polar plot from -180 to 180 degrees. 0 is on the left and positive is counter-clockwise. I'd prefer for 0 to be at the top and positive to be clockwise.

The examples in the example browser use StartAngle and EndAngle to solve both of these issues, but those properties don't seem to exist in OxyPlot.Wpf

Is there any way to do this in WPF?

objo wrote at 2014-04-19 08:37:

Added the two propeties you need. The Wpf model is not complete yet, see https://oxyplot.codeplex.com/workitem/9999