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

Maximum zoom-in limit

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

wbidus wrote at 2014-07-10 14:21:

I am using dynamic zooming in my plot, but I want to make it more user-friendly.
I wanted to implement limits, so user cannot zoom-out too far and zoom-in too close.
Limiting zoom-out is quite simple - i just set absolutemin/absolutemax values, and it works.
As far as i know, there is no out-of-the-box feature that would work similarly but for zoom-in.
Actually, I am out of ideas - i tried disabling zooming after the length of axis was too short, but after this I am not able to zoom-out again (AxisChanged event is not called anymore).

Do You guys have any ideas how I can limit zooming-in?

objo wrote at 2014-07-10 15:07:

Should we add a "MinimumRange" property to the axes? With default value double.MinValue..

wbidus wrote at 2014-07-10 15:51:

Sounds promising!

Thank You, how could I miss it? It works exactly as it should :)

Slxe wrote at 2014-07-10 16:00:

Maximum range meaning between the visible min and max points? 'cause that sounds like a pretty decent way of limiting it (also as wbidus mentioned MinimumRange already exists =P). I've said this a few times already but it'd also be nice if the AxisChanged event had more information in it's event args (like factor or new screen points).

objo wrote at 2014-07-11 22:04:

Yes, it should be the minimum between minimum and maximum. Sorry, I forgot that it was already implemented. And default value should of course be 0...
@Slxe: I think we can start a new discussion/issue on changing the AxisChanged event data. I am a bit hesitant to exposing more data than what is absolutely needed :-)

Both axis the same scale

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

everytimer wrote at 2013-08-11 19:51:

I need to display this series:

Image

Please note that it has the shape of a circle, going from -4 to 4, but as the horizontal axis is longer my circle is deformed (is an ellipse).

How can I coerce both axis to have the same scale? And this way achieve displaying a more circular shape:

Image

I need to do this automatically, I can't set it manually for each dataset. I can't use angle axis either.

Thanks

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

Try to set yourPlot.PlotType = PlotType.Cartesian
See the examples!

everytimer wrote at 2013-08-14 11:44:

Thanks, but it seems to not reseting the axis when I plot it again. I'll reset the axis manually in this case.

Pie chart click event

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

tbnguyen1407 wrote at 2013-05-02 10:30:

Hi,

Does the pie series fire MouseUp/MouseDown event? Those events do not seem to trigger when I click on the slices.
PieSeries pieSeries = new PieSeries();
pieSeries.Slices = listOfPieSlices; // populate

pieSeries.MouseDown += (o, args) =>
{
    // handle mousedown event - never trigger here
}
Thanks.

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

Sorry, the mouse events are not yet supported by the PieSeries.

But it should be quite easy to implement:
  1. store the polygons in the PieSeries.Render method in a private field
  2. in the PieSeries.GetNearestPoint method, check if the point is inside any of these polygons (use ScreenPointHelper.IsPointInPolygon)
    see a similar implementation in the BarSeriesBase and return a TrackerHitResult
If you or someone else want to make a pull request for this issue, remember to include an example!

How to set the LineSeries's line transparent e.g. 70%

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

David_NET wrote at 2013-11-22 11:04:

Q1: I have tried FromAColor. Is there another way?

Q2, is there a way to set the chart's SmoothingMode = SmoothingMode.AntiAlias;

everytimer wrote at 2013-11-22 12:12:

Q1: 0.7*255 = x
myLineSeries.ChangeAlpha(x);

Q2: No idea.

Good luck

HeatMap white in the zero values (Help)

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

Artiga wrote at 2013-08-14 13:18:

Hello guys!

I´m using a Heatmap in my application, but for me would me nice if i could let the points with of the Data[i,j] = 0, in the White color, or maybe transparent if possible ....

That is important, because i will put another kind of series above the heatmap, so it will be good for a better visualization ...

Thx for all =D

Artiga wrote at 2013-08-14 13:45:

Never mind, i found!

pcp16 wrote at 2013-12-10 14:59:

Could you post it here? I'm trying to do exactly that and have no clue! I'm new to Oxyplot!

pcp16 wrote at 2013-12-11 11:15:

Ok, solved, here's the solution (this is Objo's answer to another thread):

You can create your own palettes like so:
var palette = OxyPalette.Interpolate(NUM_COLORS, COLOR_FROM, COLOR_TO);
So in this case, we'd like to have:
var palette = OxyPalette.Interpolate(50, OxyColors.White, OxyColors.Black);
Pau.

Plot with fixed axes ratio

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

xsquare wrote at 2013-08-21 10:08:

I need to draw a plot with a fixed ratio of axes lengths. For example, I need Y-axis to be twice as long as the X-axis. How can I do that?

Thank you in advance.

everytimer wrote at 2013-08-21 11:48:

Try to set the PlotType to cartesian and the Width the double of the Height of the plot. If changing the size of the Plot is not an option you should capture the ActualMinimum/Maximum of one axis and zoom at the double starting at the lowest value. See the coupled axes Wpf example, instead of relating two axis from different plots here you should do it for the same plot. Good luck

Multiple Contour Series Exception

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

itvieira wrote at 2013-05-31 16:45:

Thanks for the your great work in providing this fantastic tool. I have started using this library to create same matlab style Contour plots and found two problems that I hope to help finding a solution. I'm using version 2013.1.46.1 (Nuget OxyPlot.Wpf_NoPCL) and Visual Studio 2012 targeting .NET 4.0.

1 - the WPF control crashes the application when using multiple contour series in the same plot, if one of the series has IsVisible = False. Basically, the invisible series still handles the mouse events and throws a System.NullReferenceException at the line 2 of ContourSeries.GetNearestPoint() method. Is there a way to disable mouse event handling for a invisible series?, I've tried both Selectable and IsSelected properties without success.

2 - The ModelPlot Axes do no reset after Series.Clear(), even though the axes min/max values have never been set previously. This is not a big deal as one can force the Axes to Reset but would be a nice to have feature.

Many thanks,

Israel

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

1 - thanks for the bug report, I have added an example (ExampleLibrary - Closed issues - Invisible contour series) and fixed the bug
2 - no collections in this library are observable, I did this to keep it simple and stupid, so you need to call the reset methods if you want the axes to go back to default ranges. I think this should be the desired behaviour.

itvieira wrote at 2013-06-08 17:09:

Many thanks for the fix and design explanation, I have no problem with the manual reset of the axes.

I just started using this library and must say that I'm very impress with your cross UI design, great work!

I'm looking forward to contribute to this library's development in the future.
Under review

Discontinuous LineSeries

Oystein Bjorke 10 jaar geleden bijgewerkt door bsguedes 10 jaar geleden 7
This discussion was imported from CodePlex

torbonde wrote at 2014-06-11 09:21:

Hi
At the moment I'm using a LineSeries, to view my data. But sometimes there might be missing datapoints, which I would like to be made aware of. I was thinking that what I want is something like LineSeries, but allowing discontinuities. For instance, such that I can specify a number (or a timespan in my case), and when two consecutive datapoints are further apart than that, no line would be drawn between them. I assume that this is not already a part of OxyPlot, but is it possible for me to implement? I have no idea where to start.

objo wrote at 2014-06-11 12:10:

Try to add a DataPoint.Undefined or set one of the coordinates to NaN. This should create a break in the line. Also see the BrokenLineStyle and BrokenLineColor properties if you want to show a line where the break is.

torbonde wrote at 2014-06-11 12:22:

Yeah, I thought of that. But there is no way to achieve this without adding a lot of NaNs? Like writing a new Series-class?

Mixed from BarSeries and LineSeries

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

Ivan_kol wrote at 2013-07-16 20:40:

Can I make on one area to create a bar graph and a line graph, so that the line graph does not really matter indices (as in the example), but the values ​​(for example: the Count - Y and Date - X), but both graphics were dependent on one coordinate.
How I can do this?

Ivan_kol wrote at 2013-07-17 19:14:

I never got to do it with a bar-graph. I have used in place of a regular bar graph, line graph.

Line direction markers

Oystein Bjorke 10 jaar geleden 0
This discussion was imported from CodePlex

Davide_sd wrote at 2014-01-13 12:43:

I've taken a look at the example browser, but apparently i didn't find a solution.
Let say i have a line composed of N points: i would like to show to the user the line direction: this is especially usefull to show the direction from the start point to the end point in closed curves.
Is there some kind of LineSeries i cas use?
If not, is it possible to use a color map into a LineSeries?

Thanks in advance!

objo wrote at 2014-01-14 20:14:

1: No, direction arrows are not supported in the standard LineSeries. You can make a custom series based on LineSeries and override the Render method to draw the arrows.
2: No, the LineSeries can only be rendered with a single color. Multi-colored lines can also be implemented as a custom series, but I think it will be difficult to get good performance with "pen-based" drawing APIs.