Kin How Chong Posted November 18, 2020 Share Posted November 18, 2020 While building an asset tree using spy.assets, the display items of a worksheet can be defined under @Asset.Display(). The list below shows the options that can be set for each parameter of the display pane: Color: str = any valid color hex for example #4055a3, #068c45, #9d248f. Line Style: str = {'Solid', 'Short Dash', 'Short Dash-Dot', 'Short Dash-Dot-Dot', 'Dot', 'Long Dash', 'Dash-Dot', 'Long Dash-Dot', 'Long Dash-Dot-Dot'} Line Width: float = {1, 1.5, 2, 2.5, ...9.5, 10} Lane: int = {1, 2, ...} Samples Display: str = {'Line', 'Line and Sample', 'Samples', 'Bars'} Axis Auto Scale: bool Axis Align: str = {'Left', 'Right'} Axis Group: str = {'A', 'B', ...} Axis Max: float Axis Min: float One example of display items set using @Asset.Display(): @Asset.Display() def Bar_Graph (self, metadata, analysis): worksheet = analysis.worksheet('BarGraph') workstep = worksheet.workstep('BarGraph') workstep.display_items = [{ "Item": self.Signal_1(), "Axis Group": "A", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Solid", "Line Width": 10, "Samples Display": "Bars", "Color": "#4055A3" }, { "Item": self.self.Signal_2(), "Axis Group": "B", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Short Dash", "Line Width": 1, "Samples Display": "Line", "Color": "#9D248F" }, { "Item": self.self.Signal_3(), "Axis Group": "B", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Solid", "Line Width": 1, "Samples Display": "Line and Sample", "Color": "#CE561B" }, { "Item": self.self.Signal_4(), "Axis Group": "C", "Axis Auto Scale": False, "Axis Align": "Right", "Axis Max": 100.5, "Axis Min": 10, "Lane": 1, "Line Style": "Solid", "Line Width": 1, "Samples Display": "Samples", "Color": "#00A2DD" }] workstep.display_range = {'Start': '2020-06-11T00:00:00', 'End': '2020-07-12T00:00:00'} workstep.view = 'Trend' return workstep 2 Link to comment Share on other sites More sharing options...
Seeq Team Sanman Mehta Posted July 28, 2021 Seeq Team Share Posted July 28, 2021 Here is an example of Scatter plot push. @Asset.Display() def Display(self,metadata,analysis): #define name of worksheet worksheet = analysis.worksheet(self.definition['Name']+' Scatter') #define name of workstep workstep = worksheet.workstep('Trends') # make sure workstep is in Scatter Plot view workstep.view = 'Scatter Plot' # define the display items - need to have at least the 2 signals you want in scatterplot workstep.display_items = [{ 'Item': self.Temperature(metadata) },{ 'Item': self.Relative_Humidity(metadata) }] # define the 2 scatterplot signals workstep.scatter_plot_series = { 'X': {'ID': self.Temperature(metadata)}, 'Y': {'ID': self.Relative_Humidity(metadata)} } return workstep #Thanks @Kjell Raemdonck for the code snippet 1 Link to comment Share on other sites More sharing options...
Kin How Chong Posted August 26, 2021 Author Share Posted August 26, 2021 On 11/18/2020 at 12:11 PM, Kin How Chong said: While building an asset tree using spy.assets, the display items of a worksheet can be defined under @Asset.Display(). The list below shows the options that can be set for each parameter of the display pane: Color: str = any valid color hex for example #4055a3, #068c45, #9d248f. Line Style: str = {'Solid', 'Short Dash', 'Short Dash-Dot', 'Short Dash-Dot-Dot', 'Dot', 'Long Dash', 'Dash-Dot', 'Long Dash-Dot', 'Long Dash-Dot-Dot'} Line Width: float = {1, 1.5, 2, 2.5, ...9.5, 10} Lane: int = {1, 2, ...} Samples Display: str = {'Line', 'Line and Sample', 'Samples', 'Bars'} Axis Auto Scale: bool Axis Align: str = {'Left', 'Right'} Axis Group: str = {'A', 'B', ...} Axis Max: float Axis Min: float One example of display items set using @Asset.Display(): @Asset.Display() def Bar_Graph (self, metadata, analysis): worksheet = analysis.worksheet('BarGraph') workstep = worksheet.workstep('BarGraph') workstep.display_items = [{ "Item": self.Signal_1(), "Axis Group": "A", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Solid", "Line Width": 10, "Samples Display": "Bars", "Color": "#4055A3" }, { "Item": self.self.Signal_2(), "Axis Group": "B", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Short Dash", "Line Width": 1, "Samples Display": "Line", "Color": "#9D248F" }, { "Item": self.self.Signal_3(), "Axis Group": "B", "Axis Auto Scale": True, "Lane": 1, "Line Style": "Solid", "Line Width": 1, "Samples Display": "Line and Sample", "Color": "#CE561B" }, { "Item": self.self.Signal_4(), "Axis Group": "C", "Axis Auto Scale": False, "Axis Align": "Right", "Axis Max": 100.5, "Axis Min": 10, "Lane": 1, "Line Style": "Solid", "Line Width": 1, "Samples Display": "Samples", "Color": "#00A2DD" }] workstep.display_range = {'Start': '2020-06-11T00:00:00', 'End': '2020-07-12T00:00:00'} workstep.view = 'Trend' return workstep There is a typo on the second item to the forth item of the workstep.display_items. The correct way to specify them is self.Signal() instead of self.self.Signal() 1 Link to comment Share on other sites More sharing options...
RMC Posted July 6, 2022 Share Posted July 6, 2022 Is there any way to add labels to signals? Link to comment Share on other sites More sharing options...
Seeq Team Sanman Mehta Posted July 6, 2022 Seeq Team Share Posted July 6, 2022 Unfortunately not. It has been accepted in feature request. If you request via [email protected] we will make sure you get an email when it’s in product future release. Btw, there is a workaround using fragile method I would not want to advertise here as well so feel free to reach out to Seeq support. Link to comment Share on other sites More sharing options...
SBC Posted August 30, 2022 Share Posted August 30, 2022 Can the above method be utilized to push a custom Python plot (for example, generated using python visualization libraries) to a WORKBENCH ? I have seen some advanced topics covering how to push it to Organizer topics (requires HTML type but was wondering if it can be done to a workbench. Link to comment Share on other sites More sharing options...
Seeq Team Sanman Mehta Posted August 31, 2022 Seeq Team Share Posted August 31, 2022 Hi SBC, This is not friendly to pushing visuals. we can discuss more on our call later this week to discuss further. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now