8 Replies Latest reply on Oct 23, 2012 3:08 PM by dhollebeek

    XYPlot - Modify most recent Point

    jvinson

      I am trying to modify the most point in an XYPlot so we can easily distinguish the most recent point drawn.  Looking in the Pi ProcessBook VBA Language Reference, it looks like the DataUpdate Event would pass in an XYPairs collection (that I assume I could reference that last item in the collection for the most recent point.  Using ProcessBook 2012 (version 3.3.0.949) when implementing that event the parameter I receive is an Integer called ntrace.  Any ideas on what's causing this mismatch or help in editing the appearance of the most recent XYPair?

        • Re: XYPlot - Modify most recent Point
          jvinson

          Should add not just the color since that is available via the UI but looking to change size or marker shape.  How do I modify the XYelements for that one point?  Thanks.

            • Re: XYPlot - Modify most recent Point

              Hello Jon,

               

              I believe the thread about Need a Vertical Line at a Certain X Value in XY Plot is very similar to what you are looking for.

               

              Can you please check it out and let us know if it was useful?

               

              Gregor

                • Re: XYPlot - Modify most recent Point

                  I think Jon has a point regarding the event signature.  The help clearly states it will provide a Pairs collection that has been updated for the XYPlot.  Instead what you get is the DataEvent update raised twice, once for each trace (X first then whichever Y trace updated) that triggered the data update.

                   

                  Is the XYPairs collection of an XYPlot appended as a new XYPair is updated?  i.e. would XYPlot.Pairs(XYPlot.Pairs.Count) within the event would give you the latest XYPair?  If 2 Y trace values are updated at the same time then is the event raised three times (X, Y, Y)?

                    • Re: XYPlot - Modify most recent Point
                      dhollebeek

                      There is built in functionality in PB for this (if I understand what you are looking for).  Edit your XYPlot and switch to the Plot Format tab.  Select Pen 1 for the Plot Element and then uncheck the check box in the middle of the dialog that is labelled Match Trace.  This will allow you to pick a different color for the Next to Last Marker and Last Marker Color.

                       

                      Take a look at the following XYPlot that shows the last 2 values (up at the top of the curve).

                       

                      6215.xyplot-last-value.jpg

                        • Re: XYPlot - Modify most recent Point
                          jvinson

                          Thanks for the suggestions.  I am looking for a way to either change the marker type aside from the color (marker type or size) possibly the the XYElement MarkerStyle property.

                           

                          I've looked at the thread Gregor mentioned.  I'm able to attain the value just not having luck with the UI properties (aside from color) with the individual points.  

                           

                          I appreciate your efforts to help!

                            • Re: XYPlot - Modify most recent Point
                              dhollebeek

                              Unfortunately, marker size and style are always the same for a XYPlot trace.  They cannot be changed for a single point either through the UI or through Automation.  You could log a suggestion through tech support and it will be considered for the next PB release.

                              1 of 1 people found this helpful
                                • Re: XYPlot - Modify most recent Point
                                  Asle Frantzen

                                  Would it be possible for OSIsoft to use the .NET charts as the visualization tool for XYPlots in the next version? After Microsoft aquired the codebase for Dundas Charts it has really become a "force to be reckoned with".

                                   

                                  I've done a lot of charts with that one, it's easy to customize - and you could let users interact with the chart object as you would in VB.Net or C#.

                                   

                                  (And btw - there is no new Major release for ProcessBook in the engineering plan, at least not before 2015. Is that correct?)

                                    • Re: XYPlot - Modify most recent Point
                                      dhollebeek

                                      Integrating .Net controls into the C++ display code would probably be more effort than it's worth (plus translating the data that we receive from the PISDK to .Net objects would affect the performance significantly - we've done a lot of research on that subject.  It is possible to wrap a .Net chart in an Active-X wrapper, but that would mean porting all the XYPlot code to .Net.

                                       

                                      While I can't specifically comment on when the next PB version will come out, it's not on the engineering plan yet because we haven't spec'd out what will and won't be in the next PB yet.  However, given our usual development life-cycle I would venture to guess that it will be before 2015.