Ben Hines Posted October 21, 2024 Posted October 21, 2024 I'm programmatically creating a scorecard metric with color bands in Seeq DataLab. I have it all working nicely, but would like to set custom colors for the color bands. I cannot figure out how to do this. Is there a way? Here's a snippet of what I've generated thus far. You can see it's using the default scorecard colors:
Seeq Team Solution Chris Harp Posted October 21, 2024 Seeq Team Solution Posted October 21, 2024 Hi Ben, The SPy documentation provides examples on how to specify the color for the thresholds when inserting metrics in an Asset Tree. Let me know if you aren't able to get either example to work. https://python-docs.seeq.com/user_guide/Asset Trees 1 - Introduction.html#inserting-metrics new_metrics = pd.DataFrame([{ 'Name': 'Overheating Severity', 'Type': 'Metric', 'Parent': 'Area A', 'Measured Item': 'Dew Point', 'Aggregation Function': 'percentile(95)', 'Bounding Condition': 'Too Hot', 'Bounding Condition Maximum Duration': '48h', 'Metric Neutral Color': '#FFFFFF', 'Thresholds': { 'HiHiHi#FF0000': 95, 'HiHi': 'Temperature', 'Hi': 85 } }]) my_tree.insert(new_metrics) https://python-docs.seeq.com/user_guide/Asset Trees 2 - Templates.html#metrics @Asset.Attribute() def Humidity_Continuous_KPI(self, metadata): return { 'Type': 'Metric', 'Measured Item': self.Relative_Humidity(), 'Statistic': 'Minimum', 'Duration': '6h', 'Period': '4h', 'Metric Neutral Color':'#189E4D', #hex color codes can be optionally appended to thresholds 'Thresholds': { 'HiHiHi#FF0000': 60, 'HiHi': 40, 'LoLo#0000ff': 20 } }
Ben Hines Posted October 22, 2024 Author Posted October 22, 2024 Thanks. I missed this in the documentation.
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