QPR ProcessAnalyzer Graph Charts: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 53: Line 53:
==Customization Examples==
==Customization Examples==
Hide legend.
Hide legend.
<pre>
<syntaxhighlight lang="json" line>
{
{
   "legend": {
   "legend": {
Line 59: Line 59:
   }
   }
}
}
</pre>
</syntaxhighlight>


Force a minimum and maximum value for the first (left side) Y-axis.
Force a minimum and maximum value for the first (left side) Y-axis.
<pre>
<syntaxhighlight lang="json" line>
{
{
   "yAxis": [
   "yAxis": [
Line 71: Line 71:
   ]
   ]
}
}
</pre>
</syntaxhighlight>


Force a minimum and maximum value for the second (right side) Y-axis.
Force a minimum and maximum value for the second (right side) Y-axis.
<pre>
<syntaxhighlight lang="json" line>
{
{
   "yAxis": [
   "yAxis": [
Line 84: Line 84:
   ]
   ]
}
}
</pre>
</syntaxhighlight>


Force a minimum value for two Y-axes (left and right side).
Force a minimum value for two Y-axes (left and right side).
<pre>
<syntaxhighlight lang="json" line>
{
{
   "yAxis": [
   "yAxis": [
Line 100: Line 100:
   ]
   ]
}
}
</pre>
</syntaxhighlight>


Force a minimum and maximum value for the second (right side) Y-axis without forcing a maximum value on the first (left side) Y-axis and giving custom titles for the two Y-axes.
Force a minimum and maximum value for the second (right side) Y-axis without forcing a maximum value on the first (left side) Y-axis and giving custom titles for the two Y-axes.
<pre>
<syntaxhighlight lang="json" line>
{
{
   "yAxis": [
   "yAxis": [
Line 121: Line 121:
   ]
   ]
}
}
</pre>
</syntaxhighlight>


Hide Y-axis label text:
Hide Y-axis label text:
<pre>
<syntaxhighlight lang="json" line>
{
{
   "yAxis": [
   "yAxis": [
Line 134: Line 134:
   ]
   ]
}
}
</pre>
</syntaxhighlight>


Hide the second Y-axis.
Hide the second Y-axis.
<pre>
<syntaxhighlight lang="json" line>
{
{
  "yAxis": [
  "yAxis": [
Line 148: Line 148:
  ]
  ]
}
}
</pre>
</syntaxhighlight>


Force a minimum value for the X-axis.
Force a minimum value for the X-axis.
<pre>
<syntaxhighlight lang="json" line>
{
{
   "xAxis": {
   "xAxis": {
Line 158: Line 158:
   }
   }
}
}
</pre>
</syntaxhighlight>


Reverse order for the Y-axis.
Reverse order for the Y-axis.
<pre>
<syntaxhighlight lang="json" line>
{
{
   "yAxis": [
   "yAxis": [
Line 169: Line 169:
   ]
   ]
}
}
</pre>
</syntaxhighlight>


Force the ''shared tooltip'' (i.e., datapoints for all series are shown in the same tooltip). By default, the tooltip is shared when there are less than 12 series. The more there are series, the more space the tooltip requires.
Force the ''shared tooltip'' (i.e., datapoints for all series are shown in the same tooltip). By default, the tooltip is shared when there are less than 12 series. The more there are series, the more space the tooltip requires.
<pre>
<syntaxhighlight lang="json" line>
{
{
   "tooltip": {
   "tooltip": {
Line 178: Line 178:
   }
   }
}
}
</pre>
</syntaxhighlight>


Here is an example how to specify multiple stacking groups. Define a name for each series and series with the same stack name will go to the same stack group.
Here is an example how to specify multiple stacking groups. Define a name for each series and series with the same stack name will go to the same stack group.
<pre>
<syntaxhighlight lang="json" line>
{
{
"series": [
"series": [
Line 198: Line 198:
]
]
}
}
</pre>
</syntaxhighlight>


By default, series appear in the alphabetical order by the series name. Use following settings to define a custom order in which series are shown in the chart:
By default, series appear in the alphabetical order by the series name. Use following settings to define a custom order in which series are shown in the chart:
<pre>
<syntaxhighlight lang="json" line>
{
{
"series": [
"series": [
Line 215: Line 215:
]
]
}
}
</pre>
</syntaxhighlight>


Define a custom order in which items are listed in the legend (if you also want to change the series order in the chart, see the "index" above):
Define a custom order in which items are listed in the legend (if you also want to change the series order in the chart, see the "index" above):
<pre>
<syntaxhighlight lang="json" line>
{
{
"series": [
"series": [
Line 232: Line 232:
]
]
}
}
</pre>
</syntaxhighlight>


Set a logaritmic scale to the left Y-axis:
Set a logaritmic scale to the left Y-axis:
<pre>
<syntaxhighlight lang="json" line>
{
{
"yAxis": [
"yAxis": [
Line 243: Line 243:
]
]
}
}
</pre>
</syntaxhighlight>


Add a scrollbar to the X-axis (the max parameter controls how many datapoints are fit to the screen):
Add a scrollbar to the X-axis (the max parameter controls how many datapoints are fit to the screen):
<pre>
<syntaxhighlight lang="json" line>
{
{
"xAxis": {
"xAxis": {
Line 255: Line 255:
}
}
}
}
</pre>
</syntaxhighlight>


Add a plotline to X-axis (perpendicular to the X-axis). Plotlines are static lines that mark for example threshold values. Plotlines can also be drawn to the Y-axis.
Add a plotline to X-axis (perpendicular to the X-axis). Plotlines are static lines that mark for example threshold values. Plotlines can also be drawn to the Y-axis.
<pre>
<syntaxhighlight lang="json" line>
{
{
"xAxis": {
"xAxis": {
Line 277: Line 277:
}
}
}
}
</pre>
</syntaxhighlight>


Add a plotband to Y-axis (perpendicular to the Y-axis). Plotbands are static lines that mark for example specific range of values. Plotbands can also be drawn to the X-axis.
Add a plotband to Y-axis (perpendicular to the Y-axis). Plotbands are static lines that mark for example specific range of values. Plotbands can also be drawn to the X-axis.
<pre>
<syntaxhighlight lang="json" line>
{
{
"yAxis": [
"yAxis": [
Line 300: Line 300:
]
]
}
}
</pre>
</syntaxhighlight>


[[Category: QPR ProcessAnalyzer]]
[[Category: QPR ProcessAnalyzer]]

Latest revision as of 16:08, 30 August 2025

Graphs are general term for column, bar, line, area, etc. charts.

Graph Colors

In graphs, colors can be defined for series (i.e. all data points of the series) and individual data points. Data point colors will have priority over the series colors.

Series colors can be defined using the following settings:

  • By default, series colors come from a default color palette.
  • Custom color palette can be defined overriding the default color palette.
  • Series color can be set for individual measures/dimensions in the measure/dimension settings (overriding the palette color).

If defined, the data point colors override series color for individual data points. Data point colors can be defined using following rules:

  • For entire graph, data point colors can be defined using a measure/dimension that is mapped to a data point color (available in the measure/dimension settings).
  • For individual series, color mappings can be used to define a specific color to specific measure/dimension value. This will override the previous one.
  • For individual series, conditional formatting can be used to define rules for data point colors (in the measure/dimension settings). This will override the previous ones.

Usecase: Visualize KPI Targets with Colors

When visualizing KPI's, it's essential show how the measure is performing comparing to targets. Targets can be visualized e.g. in charts (see more below) and in the KPI Card (see how to).

Target values can be shown in the charts as follows:

  1. Select e.g. the Column Chart as a visualization. (Colors can be visualized also with other chart types.)
  2. Select your KPI as the first measure.
  3. For the measure, select Variable for other measures in the measure settings.
  4. Select Data point colors as the second measure, and define the limit values between green-yellow and red-yellow.
  5. For the Data point colors measure, select Mapping in Chart is Data point color in the measure settings.
  6. When using charts, usually a dimension is selected as well.

Now the KPI targets are visualized as colored columns.

Conditional Formatting

Conditional formatting can be used to define colors for each data point (i.e. color for column, bar, circle etc. depending on chart type). The conditional formatting is defined in the settings of the measure/dimension that is mapped to the y-axis.

Conditional formatting example:

{
	"color": {
		"rules": [
			{
				"value": 100,
				"comparison": ">",
				"color": "#68DD8F"
			},
			{
				"color": "#EF5254"
			}
		]
	}
}

See more examples from the table conditional formatting how to define conditional formatting for graphs. Note that graphs only support the color property in the top level in the JSON.

Customization Examples

Hide legend.

{
  "legend": {
    "enabled": false
  }
}

Force a minimum and maximum value for the first (left side) Y-axis.

{
  "yAxis": [
    {
      "min": 0,
      "max": 100
    }
  ]
}

Force a minimum and maximum value for the second (right side) Y-axis.

{
  "yAxis": [
    {},
    {
      "min": 0,
      "max": 100
    }
  ]
}

Force a minimum value for two Y-axes (left and right side).

{
  "yAxis": [
    {
      "min": 0,
      "max": 100
    },
        {
      "min": 0,
      "max": 10000
    }
  ]
}

Force a minimum and maximum value for the second (right side) Y-axis without forcing a maximum value on the first (left side) Y-axis and giving custom titles for the two Y-axes.

{
  "yAxis": [
    {
      "min": 0,
      "title": {
        "text": "Left Y-axis"
      }
    },
    {
      "min": 0,
      "max": 100,
      "title": {
        "text": "Right Y-axis"
      }
    }
  ]
}

Hide Y-axis label text:

{
  "yAxis": [
    {
      "title": {
        "text": null
      }
    }
  ]
}

Hide the second Y-axis.

{
 "yAxis": [
   {
     "visible": true
   },
   {
     "visible": false
   }
 ]
}

Force a minimum value for the X-axis.

{
  "xAxis": {
    "min": 0,
    "max": 10
  }
}

Reverse order for the Y-axis.

{
  "yAxis": [
    {
      "reversed": true
    }
  ]
}

Force the shared tooltip (i.e., datapoints for all series are shown in the same tooltip). By default, the tooltip is shared when there are less than 12 series. The more there are series, the more space the tooltip requires.

{
  "tooltip": {
    "shared": true
  }
}

Here is an example how to specify multiple stacking groups. Define a name for each series and series with the same stack name will go to the same stack group.

{
	"series": [
		{
			"stack": "stack1"
		},
		{
			"stack": "stack1"
		},
		{
			"stack": "stack2"
		},
		{
			"stack": "stack2"
		}
	]
}

By default, series appear in the alphabetical order by the series name. Use following settings to define a custom order in which series are shown in the chart:

{
	"series": [
		{
			"index": 2
		},
		{
			"index": 0
		},
		{
			"index": 1
		}
	]
}

Define a custom order in which items are listed in the legend (if you also want to change the series order in the chart, see the "index" above):

{
	"series": [
		{
			"legendIndex": 2
		},
		{
			"legendIndex": 0
		},
		{
			"legendIndex": 1
		}
	]
}

Set a logaritmic scale to the left Y-axis:

{
	"yAxis": [
		{
			"type": "logarithmic"
		}
	]
}

Add a scrollbar to the X-axis (the max parameter controls how many datapoints are fit to the screen):

{
	"xAxis": {
		"max": 15,
		"scrollbar": {
			"enabled": true
		}
	}
}

Add a plotline to X-axis (perpendicular to the X-axis). Plotlines are static lines that mark for example threshold values. Plotlines can also be drawn to the Y-axis.

{
	"xAxis": {
		"plotLines": [
			{
				"color": "red",
				"dashStyle": "dash",
				"value": 50,
				"width": 2,
				"label": {
					"text": "This is a plotline",
					"style": {
						"fontSize": 13
					}
				}
			}
		]
	}
}

Add a plotband to Y-axis (perpendicular to the Y-axis). Plotbands are static lines that mark for example specific range of values. Plotbands can also be drawn to the X-axis.

{
	"yAxis": [
		{
			"plotBands": [
				{
					"color": "lightblue",
					"from": 10,
					"to": 50,
					"label": {
						"text": "This is a plotband",
						"style": {
							"fontSize": 13
						}
					}
				}
			]
		}
	]
}