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

Rendering contexts

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

cpuserdi wrote at 2013-08-01 21:24:

I see there has been some work to support multiple rendering contexts. At the moment, only ShapesRenderContext is working. What's the status of the other contexts? Especially DrawingRenderContext. Seems a little outdated and incomplete. Has there been any testing into this area that merits further pursuit?

objo wrote at 2013-08-07 13:07:

I did not see any performance improvements with the other rendering contexts for WPF, so only ShapesRenderContext has been updated.
There were also some visual issues with the other rendering contexts that I did not have with the one based on shapes.
To improve performance in WPF, I would rather look at DirectX based solutions as in VisiBlox and LightningChart!

(WinRT) Styling a PieSeries in XAML

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

rukko wrote at 2013-03-12 11:38:

Hi

I'm trying to use a PieSeries in XAML, so that I can bind the values of the PieSlices directly to properties, letting me wrap the entire thing in a UserControl.

I'm having trouble specifying the Fill property. OxyColor does not support conversion from a string, and I can't stick one in a page resource because XAML does not support conversion from string to bytes (required to specify the R, G and B values of the colour).

Here is the XAML (where metro: is OxyPlot.Metro, and oxy is OxyPlot)
     <metro:Plot Width="50" Height="50">
        <metro:Plot.Model>
            <oxy:PlotModel>
                <oxy:PlotModel.Series>
                    <oxy:PieSeries InnerDiameter="0.7"
                                       StartAngle="-90">
                        <oxy:PieSeries.Slices>
                            <oxy:PieSlice Value={Binding Progress} Fill="???"/>
                            <oxy:PieSlice Value={Binding ProgressComp}/>
                        </oxy:PieSeries.Slices>
                    </oxy:PieSeries>
                </oxy:PlotModel.Series>
            </oxy:PlotModel>
        </metro:Plot.Model>
    </metro:Plot>
I wrote a converter to convert a Color to an OxyColor (and then assigning the value to the Fill property of the slice), but I receive a XamlParseException: Unable to assign to property 'Fill' at runtime.

Any help?

DateTimeAxis Interpolation

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

Jumaga2015 wrote at 2013-05-06 17:41:

Hi, I want to make a graphic with price series and I find the problem that interpolates the price series when one day has no data.

It is possible to generate a DateTimeAxis with only the days in the serie?
Dates may behave in the serie like a ordinal serie?

congratulations, OxyPlot is a great job.

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

The DateTimeAxis is based on the LinearAxis:
  • DateTime values are converted to double values (days since 1900, like Excel)
  • tries to find automatix major/minor intervals that are 'nice'
  • converts the double values to DateTime before formatting labels
Use the DateTimeAxis.ToDouble static method to get the ordinal values for the dates.
Undefined points should not be plotted, if you want to interpolate you must do this in your code.

TIFF export

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

ambrein2 wrote at 2014-01-24 17:47:

Does OxyPlot support exporting reports to TIFF files? I really need that feature and I like OxyPlot so far but not sure if it supports TIFF. Any ideas? If it doesn't support does anyone know of a solution out there for TIFF export?

objo wrote at 2014-01-25 22:50:

Can TIFF be used for reports - text and tables and so on??

Or do you want to export plots in a report to TIFF?
Only PNG is supported - see the PngExporter on most platforms.
http://oxyplot.org/doc/API/OxyPlot.Wpf.PngExporter.html

For WPF you can easily add TIFF export: Create a class like PngExporter, and replace the PngBitmapEncoder by a TiffBitmapEncoder
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.tiffbitmapencoder(v=vs.110).aspx

ambrein2 wrote at 2014-01-27 17:21:

Hi objo,

Yes I want to be able to export plots in a report to TIFF. Thanks for the links to TiffBitmapEncoder. I will try out what you have suggested. Do you think the quality of exported tiff will be good using TiffBitmapEncoder? One of my requirements is that when zoomed in to the TIFF report should still have high quality(no jaggies).

Thanks,
Mandar

objo wrote at 2014-01-27 19:16:

If you want scalable graphics, you should export to SVG or PDF. Both are supported in the core library of OxyPlot!

If you implement a exporter based on TiffBitmapEncoder, try TiffCompressOption.None:
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.tiffcompressoption(v=vs.110).aspx

Tornado Plots

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

RobUrsem wrote at 2012-03-08 05:07:

I'm looking at OxyPlot for use in our application and I'm very impressed by the functionality but also the incredible speed.

Since our application is very heavy on statistical analysis, we require rendering of Tornado Plots (http://en.wikipedia.org/wiki/Tornado_diagram). I tried to recreate this with the bar chart in OxyPlot, but I cannot get it to work. One reason for this is that the bar plot assumes there is only a single value, where the tornado plots usually have two (a minimum and a maximum). Furthermore I need each bar to have a different color. If I use a collection of 'items' I don't see a way to specify a minimum and a maximum value as well as a bar color. 

It would be great if this could be considered as a feature in the near future.

I'm hoping that with a simple extension this can be achieved, but as I only have looked at the toolkit recently and the documentation currently is rather 'thin' I have no idea where to start doing that. If it is relatively straight forward to implement this type of plot, could anyone give me a shove in the right direction?


objo wrote at 2012-03-09 08:44:

It is possible to create a tornado plot by two stacked BarSeries where you set the BaseValue property. The Maximum and Minimum values must be relative to the BaseValue. I will add an example on this.

But I see a custom "TornadoBarSeries" would be easier to use, and it should be quite easy to implement.

- should it only support horizontal bars (not columns)?

- two colours only? (one for the minimum and one for the maximum values)

- labels at the minimum and maximum? (I didn't quite understand the numbers on the wikipedia page)

- automatic sorting? (sort by length of bar?)


RobUrsem wrote at 2012-03-09 15:54:

Objo,

Only horizontal bars would be needed. Indeed they are sorted such that the longest bar is always at the top.

Yes the labels at the min and the max are needed. Usually they have two colors but in the plots that we have in our current product, each of the bars have a different color. If we would be able to provide a collection of colors that would be best.


objo wrote at 2012-03-12 06:25:

I added a "TornadoBarSeries" where you can specify a BaseValue and a collection of Minimum, Maximum values. Sorting of the items is not implemented, that should be done by the code that creates the series. It is possible to set the color of the "minimum" and "maximum" parts of the bars in the TornadoBarSeries, or for each item.

See the TornadoBarSeries example in the ExampleLibrary/ExampleBrowser. 

Polar / Linear axes on the same plot

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

tboloo wrote at 2013-02-28 21:15:

Dear oxyplotter,
I am trying to recreate following chart
Image
So far I have achieved such effect:
Image
which is not quite what I want. My question is: is it possible at all to create such plot using oxyplot (with radial plot being clipped by linear, etc.) ?
Looking forward for the answer,
Bolek.

objo wrote at 2013-03-13 21:38:

I think the easiest solution would be to create a custom annotation that renders the polar coordinate system. The Annotation base class contains references to the X and Y axes, and there are IRenderContext extension methods that supports line clipping!

tboloo wrote at 2013-03-18 09:09:

Hi objo,
Thank you for the reply, I managed to get the desired effect with annotations.
Regards,
Bolek.

David_NET wrote at 2013-12-09 10:30:

I am working on polar plot, it would be great to see some code on how to combine annotation to get the effect you need. Can you share the code?

objo wrote at 2013-12-09 21:45:

Please create an example we can include in the example library :)
0

OxyPlot LineSeries Tracker Property DataPoint

some individuum 9 year бұрын жаңартылды 8 year бұрын 2
After the IDataPoint Interface was removed, I face the following problem:

I have a List of DataPoints, rendered as a LineSeries. I was working on converting these datapoints to a custom format to add my own property that should be calculated just-in-time (if possible) or beforehand if not.
As the IDataPoint Interface is missing I can not have a function on my CustomDataPoint to calculate the difference to a certain value as I intended to build:

(With TrackerString = "....{difference}")

MyDataPoint : IDataPoint
{
public string difference
{
get
{
return (certainDataValue-X)
...

As DataPoint is a struct I can not expand it to add this calculation. Do you know of any way that I can achieve this without implementing my own tracker feature?

Thanks alot!

0x54726F6E

OxyPlot with dynamic data series

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

cpuserdi wrote at 2013-07-30 21:09:

Any advice/tips on plotting one or more dynamic data series efficiently? What types of classes should I consider writing to increase performance? Axis, Series, Rendering contexts, etc.


cpuserdi wrote at 2013-08-01 14:58:

That can only go so far and I'm already doing that. I'm looking for performance in keeping the plot up-to-date rather than simply drawing a large number of points.

everytimer wrote at 2013-08-01 17:23:

Sorry can't help you there. See the animated examples, seems pretty fluent to me.
Good luck

Contour Plot

Oystein Bjorke 10 year бұрын updated by Pavithra K S 8 year бұрын 1
This discussion was imported from CodePlex

nitekonline wrote at 2014-06-03 15:43:

I'm new to oxyplot so please bare with me.
I'm trying to plot a contour map/heatmap to produce a representation of a wafer thickness.
I only have xyz dataset as follows:
X               Y             Z 
0.025        6.915       202.17 
-50.116     61.255     144.99 
50.123      61.295     172.92 
50.166     -47.425    218.53 
-50.074    -47.465   162.61 
-0.018      115.635   152.77 
100.233   88.494     192.23 
125.325    6.964      155.08 
100.297   -74.586    145.74 
0.078      -128.985   216.98 
-100.183  -74.664    146.37 
-125.275   6.866     134.94 
-100.247   88.416   119.83 
-75.198   115.605   127.53 
75.162     115.664   178.94 
75.248    -101.776   159.43 
-75.112   -101.835  150.74 
Could someone provide me some guidance on how to plot this?
Thanks

cureos wrote at 2014-06-03 16:15:

I might be out on a limb here, but I think that both ContourSeries and HeatMapSeries expect a 2-D rectilinear grid of data.

If this is indeed the case, you would first need to sample your scattered 2-D data onto a rectilinear grid with some kind of interpolation technique (Wikipedia). Then, initialize your ContourSeries or HeatMapSeries using the resampled rectilinear grid. You'll find sufficient code examples in the example browser for defining these types of series.

nitekonline wrote at 2014-06-03 16:50:

You are right, cureos. Need to create a rectilinear grid based on the data. Thank you for your guidance.

Selection of range

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

amity2001 wrote at 2012-10-09 08:08:

First of all, thank you very much for such a great library.

I am looking for feature of selection of range in graph.

Is it possible to select particular area on graph similar to rectangular zooming by dragging mouse with middle button?

Please refer similar feature of FLOT library here, http://people.iola.dk/olau/flot/examples/selection.html

Thanks in advance.


objo wrote at 2012-10-09 21:08:

Yes, this should be possible by handling mouse events on the PlotModel and modifying a RectangleAnnotation. See the mouse event examples in the example browser, which do almost the same thing.


objo wrote at 2012-10-09 21:52:

See the new example in the the example browsers: "Mouse events | Select range"