# Polar Plot for Electrical Phasor Diagram

**URL:** <https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195>\
**Category:** Ignition\
**Created:** [January 29, 2019, 4:42pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195 "2019-01-29T16:42:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimE](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@TimE](https://forum.inductiveautomation.com/u/TimE)\
**Post date:** [January 29, 2019, 4:42pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/1 "2019-01-29T16:42:49Z")

</div>

We have several power meters and I would like to create a phasor diagram for these. Has any one created something like this already? I attached an image of what it looks like. ![Phasor](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/637b9e260f4a28ed95f76c2b5d0be13c8689a5d1.png)

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [January 29, 2019, 5:25pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/2 "2019-01-29T17:25:44Z")

</div>

I’ve seen something like this on the forum, but can’t remember where and my first couple guesses at search terms came up empty. You may have better luck than me searching.

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [January 29, 2019, 5:27pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/3 "2019-01-29T17:27:40Z")

</div>

I think the paintable canvas is what you’re looking for here. It’d be fairly easy to create one that shows that circle and a few arrows and text.

One suggestion for that though is make sure you do as many time-intensive scripting outside of the paintable canvas’s repaint() method, that will slow everything down. But if you just feed it a dataset of labels, colors, etc and plot it, it should work great.Then use normal labels and stuff for the top part of that picture.

---

<div class="post-metadata">

**Author:** ![jgooding](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jgooding](https://forum.inductiveautomation.com/u/jgooding)\
**Post date:** [January 29, 2019, 6:44pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/4 "2019-01-29T18:44:00Z")

</div>

It is talked about in a sample project at

> [@Project screenshots - share yours](http://forum.inductiveautomation.com/t/project-screenshots-share-yours/513/29):
>
> Energy metering project in progress. Overview Single meter detail Construction of the power factor meter was interesting. I drew the voltage vectors, the inductor (beziers) and capacitor. The current vectors are done using the ‘meter’ display and hiding most of its (rather ugly) features. Set the Value property to an Expression Tag to calculate the angle. In my case it was: acos({Nifty PF vector instrument.PF1}) etc. Note that this returns radians so I just set the limi…

See if that helps!!!

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [January 29, 2019, 6:49pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/5 "2019-01-29T18:49:37Z")

</div>

Good find, that’s interesting. I’m just wondering how they did the labels at the end of the arrow in that example. I don’t use the meter component much so I’m not very familiar with it.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [January 29, 2019, 8:26pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/6 "2019-01-29T20:26:40Z")

</div>

> [@jgooding](#):
>
> It is talked about in a sample project at

That's the one I was thinking of; thanks!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 29, 2019, 10:35pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/7 "2019-01-29T22:35:20Z")

</div>

I created the energy meter post linked above. I think I just used labels. The voltage phasors don’t move so their labels remain fixed. Only the current phasors rotate but they don’t have labels.

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [January 31, 2019, 1:29am UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/8 "2019-01-31T01:29:29Z")

</div>

Example window made using Ignition 7.9.6  
[Polar\_796.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/539e1af2b184f6f4ab349640b656ae5d13286dc4.proj) (20.2 KB)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a23e521a7a7091cb893c01ab0c15e02050a7cb7f.png)

---

<div class="post-metadata">

**Author:** ![TimE](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@TimE](https://forum.inductiveautomation.com/u/TimE)\
**Post date:** [January 31, 2019, 6:04pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/9 "2019-01-31T18:04:41Z")

</div>

I found this a couple days ago and started modifying it. I made it to the point of adding the current phasors and was pulled off to another project.

[Carl Gould Solution](http://forum.inductiveautomation.com/t/scatter-chart/5312)

I downloaded the polar project above and tried to import it into V7.9.8 and I get an error parsing the file.

```auto
...com.inductiveautomation.ignition.gateway	31Jan2019 11:49:14	Error parsing project file.
org.xml.sax.SAXParseException: Premature end of file.

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)

at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

at com.inductiveautomation.ignition.common.project.Project.hasVersionInfo(Project.java:1309)

at com.inductiveautomation.ignition.common.project.Project.hasVersionInfo(Project.java:1295)

at com.inductiveautomation.ignition.gateway.web.pages.config.ProjectUploadPage$1.onSubmit(ProjectUploadPage.java:78)

at org.apache.wicket.markup.html.form.Form$9.component(Form.java:1248)

at org.apache.wicket.markup.html.form.Form$9.component(Form.java:1242)

at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:274)

at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:245)

at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1241)

at org.apache.wicket.markup.html.form.Form.process(Form.java:923)

at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:769)

at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:702)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)

at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)

at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:240)

at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226)

at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:814)

at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)

at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)

at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)

at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)

at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)

at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)

at com.inductiveautomation.ignition.gateway.bootstrap.SRFilter.doFilter(SRFilter.java:80)

at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1160)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1092)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)

at org.eclipse.jetty.server.Server.handle(Server.java:518)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:244)

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)

at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:186)

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)

at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)

at java.lang.Thread.run(Unknown Source)

```

It looks like you created what I am looking for. I started off by scaling the magnitude with varying lengths of the vectors but yours looks better with fixed lengths.

Tim

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [January 31, 2019, 6:19pm UTC](https://forum.inductiveautomation.com/t/polar-plot-for-electrical-phasor-diagram/22195/10 "2019-01-31T18:19:05Z")

</div>

I’ve updated the window with 7.9.6
