Jump to content

Custom scorecard colors


Go to solution Solved by Chris Harp,

Recommended Posts

Posted

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:
image.png.4b8c8c932b5f7beb55eafd0f4e98a235.png

  • Seeq Team
  • Solution
Posted

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
            }
        }

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...