Electric Power factor Chart

May 14, 2012 at 10:29 PM

Hi Objo, 

I have a strange question.

Can I plot a chart that 4th quadrant ranges from -0.001 to 1 and the 1st quadrant ranges from 0.001 to 1? to produce a chart like this sketch with oxyplot?

We are doing an electrical engineering chart of power factor measurement. And the chart must be Like this.

    ^
 0.0|
    |
    |
 0.5|
    |
    |
 1.0|------------------------------------------->
    |
    |
-0.5|
    |
    |
 0.0|


Coordinator
May 15, 2012 at 5:07 AM

That's a special case not supported by the LinearAxis.

You have to make a custom axis yourself to do this. Look at the LinearAxis implementation, maybe you can just override some of the methods of the LinearAxis class. Let me know if I should make more methods virtual.

May 15, 2012 at 12:07 PM

Ok I'll look for this. I asked only to know if possible. I think only in July or August we'll do something like this.

Nov 14, 2012 at 10:24 AM
Edited Nov 19, 2012 at 5:46 PM

Just for information, I achieved to do this graph by extending LinearAxis and overriding method 'virtual string FormatValue (double x)'. By doing this way the axis will show the values you want by modifying the value passed to base.FormatValue(x). It requires recalculating some values, though (for instance, I've chosen to convert values in the range shown in the desired chart to -1 to 1).

It is also necessary to change values shown by the tracker, for this I created PFSeries which extends LineSeries, and whose GetNearestPoint method is overridden in order to return a PFTracker (which extends TrackerHitResult).

Coordinator
Nov 14, 2012 at 6:27 PM
Edited Nov 14, 2012 at 6:27 PM

One more idea... try to create two vertical axes:
The first: Minimum=0.001, Maximum=1, StartPosition=1.0, EndPosition=0.5
The second: Minimum=-0.0001, Maximum=1, StartPosition=0, EndPosition=0.5

Then add one series for the data in the 4th quadrant, and one series for the data in the 1st quadrant.

(I have not tested this...)

Nov 19, 2012 at 5:45 PM

I've tried this but with two axes zoom is no longer synchronized between quadrants, and you would need to add two series actually, instead of one (one series for the upper chart and another for the lower one).