I am experimenting with Status Charts. I was wondering if there is a good way to right click on the Status Chart and popup the current value and time. If there are any good examples on using the configureChart for the "Status Chart" component, please share. Thank You.
When you say "Status Chart" what chart are you looking at exactly?
These are the options you have for charts in base Ignition.
Could you provide a little more info to allow others to assist you.
Benjamin Good Morning. I think accidentally referenced this question to Perspective not Vision.
Ah, that is where my confusion was. I see you fixed your tag
So I don't believe there is any native way to do this with properties alone.
You will need to use the extension function configureChart to add some event handlers for on click of the series items.
Here is the docs for vision status chart scripting functions:
Vision - Status Chart Scripting Functions | Ignition User Manual (inductiveautomation.com)
You will find it talks about the JFreeChart object which is passed in to the configureChart extension function.
Here is the docs for that:
Overview (JFreeChart 1.5.0 API)
You should be able to find an implantation of doing what you want with this.
I recommend looking up specifically jython 2.7 examples of it as they will have proper imports for things like from org.jfree.chart.event import ChartMouseListener
etc. where you will need those to properly configure the event handlers. We rarely use Vision anymore, so I am a little rusty on some of the specifics with the JFreeCharts.
Hope this helps, and maybe there are others more versed in the specifics or have a better solution than this.
Appreciate your time. I will jump into the information you shared immediately.
Awesome,
If it works for you don't forget to mark as a solution so others know that this answered this question to avoid duplicate questions on the forum.
A right click is going to open the chart's native popup menu that gives the user options like zooming, printing, or saving. Typically, the value and timestamp of a specific point on the status chart is displayed by hovering the mouse at that point to reveal the tool tip. The status chart has a getToolTip
extension function that can be used to customize what the tool tip displays.
Example:
#def getTooltipText(self, seriesIndex, selectedTimeStamp, timeDiff, selectedStatus, data, properties, defaultString):
return 'Machine Status = {}, Time:{}'.format(selectedStatus, system.date.format(system.date.fromMillis(long(selectedTimeStamp * 1000)), 'HH:mm:ss'))
Result: