QPR ProcessAnalyzer Table

From QPR ProcessAnalyzer Wiki
Revision as of 18:50, 21 June 2020 by Ollvihe (talk | contribs)
Jump to navigation Jump to search

Table conditional formatting is defined as a JSON object with following properties:

  • backgroundColor
  • textColor
  • rules: rules are check in their order and the first matching determines the color.
    • color
    • limit
    • comparison: <, >, <=, >=, ==, !=
  • scales

Example: Background color is based on the following rules:

  • if value is lower or equal to 5, background color is #FF0000
  • if value is between, 5 and 10, background color is #FFFF00
  • if value is greated than 10, background color is #00FF00
{
	"backgroundColor": {
		"rules": [
			{
				"color": "#FF0000",
				"limit": 5,
				"comparison": "<="
			},
			{
				"color": "#FFFF00",
				"limit": 10,
				"comparison": "<="
			},
			{
				"color": "#00FF00",
				"limit": 50,
				"comparison": ">"
			}
		]
	}
}

Example: Background color is based on a color scale where column minimum value gets color #FFFFFF and maximum value #FFD851. Color is scaled linearly between these colors.

{
	"backgroundColor": {
		"scale": [
			[{ "aggregate": "min" }, "#FFFFFF"],
			[{ "aggregate": "max" }, "#FFD851"]
		]
	}
}

Example: Similar to previous example, except minimum and maximum values come from another column (measure number 1).

{
	"backgroundColor": {
		"scale": [
			[{ "type":"measure", "index": 1, "aggregate": "min" }, "#FFFFFF"],
			[{ "type":"measure", "index": 1, "aggregate": "max" }, "#FFD851"],
		]
	}
}
"conditionalFormatting": {
	"backgroundColor": {
		"color": "#FFD851"
	}
}
"conditionalFormatting": {
	"textColor": {
		"rules": [
		{
			"color": "#FF0000",
			"limit": 20,
			"comparison": "<="
		},
		{
			"color": "#00FF00"
		}
	]
	}
}
"conditionalFormatting": {
	"icon": {
		"rules": [
		{
			"icon": "star",
			"limit": 100,
			"comparison": ">"
		}
	]
	},
	"iconColor": {
		"rules": [
		{
			"color": "#00FF00",
			"limit": 500,
			"comparison": ">"
		},
		{
			"color": "#FF0000",
		}
	]
	}
}
"conditionalFormatting": {
	"databar": {
		"min": 0,
		"max": { "type":"dimension", "index": 1, "aggregate": "min" }
		"direction": "right"
	}
}