Histogram visualizes statistics collected by a number of Histogram Data objects. The X-axis is always scaled to fit all histogram data ranges. The histograms are also scaled along the Y-axis so that the highest bar of each histogram occupies the full height of the picture. The PDF bars, the CDF line, and the mean location can be shown optionally.
PDF (probability distribution function) is displayed as a number of vertical bars each corresponding to a particular interval with their height proportional to the density (or number) of data samples within the interval. The bars may be set up to look like solid blocks or distinct bars.
CDF (cumulative distribution function) is displayed as a polyline on top of PDF, and the mean value is a vertical line at the corresponding value axis position.
If percentiles are calculated and both low and high confidence measures are specified, the bars corresponding to the lower and higher confidence measures are highlighted with the given colors. The bars that contain the exact “values at risk” (values satisfying the equation CDF(value) = low confidence measure or CDF(value) = 100 – high confidence measure) are drawn in the corresponding intermediate colors.
To create a histogram
- Drag the Histogram element from the Analysis palette into the graphical editor.
- Go to the Properties view and set up the histogram properties.
- Add data objects collecting statistical data you want to be displayed on this histogram. Add data objects successively by clicking the button in the Data section of the properties and configuring just added object in the property section opened below. Enter the name of the Histogram Data object in the Histogram box and optionally alter some presentation options using the controls below.
- In the Title box, type the text that will be shown in the chart legend as the title of this data item.
- If you want PDF bars to be shown, select the Show PDF check box and alter PDF color for histogram data objects in the Style menu of the Data property section.
- If you want CDF to be shown, select the Show CDF check box and alter CDF color for histogram data objects in the Style menu of the Data property section.
- If you want the mean line to be shown, select the Show Mean check box and alter Mean color for histogram data objects in the Style menu of the Data property section.
- If some histogram data objects displayed on this histogram calculate percentiles, you can optionally alter the color of the PDF to the left of the low confidence value in the Low % color box and the color of the PDF to the right of the high confidence value in the High % color box in the Style menu of the Data property section.
- General
-
Name — The name of the chart. The name is used to identify and access the chart from the code.
Data representation — Specifies how the data is shown on the histogram:
Show PDF — If selected, PDF is shown on the histogram.
Show CDF — If selected, CDF is shown on the histogram.
Show mean — If selected, the mean value is shown with a line.Ignore — If selected, the chart is excluded from the model.
Lock — If selected, the chart is locked, so it could not be selected in the graphical editor with a mouse click. Model developers would not be able to move it, resize, or modify its properties anyhow, unless the chart is unlocked.
- Data
-
Depending on the type of the chart, one or more data items may already be present in its properties.
Add — This button opens a new property section, which allows for configuring the data you want to visualize on this chart.
Title — The title for this data item. It will be shown in the chart legend.
Data — The name of the Histogram Data object which will be displayed on this histogram.
Style — Click to access extra data item appearance options:
PDF color — [Enabled if Show PDF is selected] The color which will be used to draw PDF of this histogram data. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
CDF color — [Enabled if Show CDF is selected] The color which will be used to draw CDF of this histogram data.
Mean color — [Enabled if Show mean is selected] The color of the line which will visualize the mean value of this histogram data. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
CDF & Mean line width — [Enabled if Show CDF or Show mean is selected] Width of CDF and/or mean line.
Low % color — [Enabled if percentiles are collected for the histogram data] The color which will be used to draw PDF to the left from the low percentile. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
High % color — [Enabled if percentiles are collected for the histogram data] The color which will be used to draw PDF to the right from the high percentile. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
Use the and arrows to arrange the order of the data item sections.
To remove the data item from the chart, click the button below the data item’s property section.
- Data update
-
Update data automatically — If selected, new data samples will be added automatically with the specified Recurrence time. You can also specify whether you want to Use model time or Use calendar dates. Depending on this choice, you can specify when to start updating using either the First update time or Update date properties.
- Legend
-
Show legend — If selected, the chart legend is displayed.
Position — [Enabled if Show legend is selected] Sets the legend position (relative to the chart).
Area size — [Enabled if Show legend is selected] The size of the area allocated for the chart legend.
For the North and South positions, this setting affects the area’s height. For the East and West positions, this setting affects the area’s width.Text color — The color of the legend’s text. Click the colored box to choose the custom color using the color picker.
To adjust the text’s transparency, use the edit box on the color picker’s right. - Appearance
-
Bars relative width — Specifies the thickness of the bars (1 — maximum possible without bars overlapping each other, 0.5 — half, and so on).
Vertical axis labels — Specifies the position of the vertical axis labels relative to the chart.
Left
Right
None — No labels will be displayedStyle — Click to access extra appearance options:
Background color — The background color of the chart. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
Labels color — The chart label color. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
Grid color — The chart grid color. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
Border color — The chart border color. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
- Position and size
-
Level — The level this chart belongs to.
X — The x-coordinate of the chart’s upper left corner.
Y — The y-coordinate of the chart’s upper left corner.
Width — The width of the chart shape (in pixels).
Height — The height of the chart shape (in pixels).
- Chart area
-
This section defines the visual properties of the chart area.
X Offset — The x-offset of the chart area relative to the whole area allocated for the chart and all its accompanying elements.
Y Offset — The y-offset of the chart area relative to the whole area allocated for the chart and all its accompanying elements.
Width — The width of the chart area (in pixels).
Height — The height of the chart area (in pixels).
Style — Click to access extra options:
Background color — The chart area background color. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
Axis color — The chart area axis color. Click the colored box to choose the custom color using the color picker, or use the edit box on the color picker’s right to adjust the color’s transparency.
- Data items
-
Function Description void addHistogram(HistogramData hist, String title, Color colorLowPercent, Color colorHighPercent, Color colorPDF, Color colorCDF, float lineWidthCDF, Color colorMean) Adds a histogram data object to the chart with the specified visual appearance.
hist — the histogram data object to add.
title — the histogram data title.
colorLowPercent — the color to draw the PDF bars of the low percentile.
colorHighPercent — the color to draw the PDF bars of the high percentile.
colorPDF — the color to draw the PDF bars.
colorCDF — the color to draw the CDF line.
lineWidthCDF — the CDF line width, 0 for thinnest possible.
colorMean — the color to draw the mean line.int getCount() Returns the number of data items currently displayed by this chart. HistogramData get(int i) Returns the chart’s HistogramData item with the given index.
i — The index of the data element.String getTitle(int i) Returns the title of chart’s HistogramData item with the given index.
i — The index of the data element.Color getColor(int i) Returns the PDF color of the histogram item with the given index.
i — index of the item.void setColor(int i, Color c) Sets the new PDF color of the histogram item with the given index.
i — the index of the item.
c — the new color of the item.void remove(int i) Removes the HistogramData item with the given index from the chart.
i — the index of the item.int remove(ChartItem ci) Removes the given HistogramData item from the chart.
ci — The chart item to remove.void removeAll() Removes all items from the chart. - Selecting data items
-
Function Description void selectItem(int itemIndex, boolean selected) Selects or deselects (depending on the selected value) the chart item with the given index.
itemIndex — The index of the data element.
select — sets whether to select or deselect the element.void setSelectedItemIndices(int[] selectedIndices) Selects only chart items with the given indices.
selectedIndices — an array with indices of chart items to be selected (other chart items will be deselected), may be null — this clears selection.int[] getSelectedItemIndices() Returns the number of chart items (data items or data sets) currently displayed by this chart. - Updating chart data manually
-
Function Description void updateData() Updates all data items displayed by this chart. - Location
-
Function Description double getX() Returns the X coordinate of the chart (namely, the X coordinate of its upper left corner). double getY() Returns the Y coordinate of the chart (namely, the Y coordinate of its upper left corner). void setX(double x) Sets the X coordinate of the chart.
x — the new value of the X coordinate.void setY(double y) Sets the Y coordinate of the chart.
y — the new value of the Y coordinate.void setPos(double x, double y) Sets new coordinates for the chart shape.
x — the new value of the X coordinate.
y — the new value of the Y coordinate. - Size
-
Function Description double getWidth() Returns the width of the chart shape. double getHeight() Returns the height of the chart shape. void setWidth(double width) Sets the new width for the chart shape.
width — the new value of the chart width.void setHeight(double h) Sets the new height for the chart shape.
h — the new value of the chart height. - Visibility
-
Function Description boolean isVisible() Checks the visibility of the chart. Returns true if the chart is visible, and false otherwise. void setVisible(boolean v) Sets the visibility of the chart.
v — visibility: if true — the chart is set to be visible, if false — not visible.
-
How can we improve this article?
-