Production Bar Chart

Sepasoft MES Module Suite

Bar Chart

A component that displays a pie chart with drill down capabilities. This extends from the Bar Chart Component  that comes with Ignition.

Component Palette


Features

The Drill Down Options property allows custom menu items to be added. When the user clicks on a bar of the bar chart, the drill down menu will appear. When an item in the drill down menu is clicked on, the drillDown event is fired. Script in the drillDown event is responsible for updating the Data property to change the results shown in the bar chart. The drill down menu information is set through the Drill Down Options property. The Drill Down Options can be populated from the Analysis Controller, Analysis Selector, SQL Query, scripting or it can be manually defined in the designer.

Production Bar Chart



Component Properties

Properties are provided that can be set to affect the operation and look of the component. They can be set through the Property Editor in the Designer or through scripting.

Example

Code
event.source.parent.getComponent('Production Bar Chart').previousDrillDownEnabled = True

Behavior

NameScriptingProperty TypeDescription
Tooltips?tooltipsbooleanShould tooltips be displayed when the mouse hovers over sections?

Data

NameScriptingProperty TypeDescription
DatadataDatasetData driving the chart.
Drill Down OptionsdrillDownOptionsDatasetDataset with drill down options.
Previous Drill Down EnabledpreviousDrillDownEnabledbooleanIf true, show previous in drill down menu.
Data QualitydataQualityintThe data quality code for any tag bindings on this component.
Extract OrderextractOrderint

Controls whether the first row defines the categories or the series.

0 = By Column
1 = By Row

Category Date FormatcategoryDateFormatStringFormat the category if it is a date.

Appearance

NameScriptingProperty TypeDescription
Chart TitletitleStringAn optional title that will appear at the top of the chart.
Chart TyperendererTypeint

Controls how the bar chart is displayed.

0 = Bar
1 = 3D Bars
2 = Stacked Bars
3 = 3D Stacked Bars
4 = Layered
5 = Area

Plot BackgroundplotBackgroundColorBackground color for the plot.
Plot Border ColorplotBorderColorColorBorder color for the plot.
Shadow ColorshadowColorColorShadow color for the plot.
Series ColorsseriesColorsColorThe sequence of colors used for series in the bar chart.
Legend?legendbooleanShould there be an item legend below the chart?
Gradient bars?gradientbooleanIf true, bars will be painted with a gradient 'shine'.
Foreground TransparencyforegroundAlphaFloat4Transparency of the pie.
VerticalverticalbooleanSets the orientation of the chart to vertical (true) or horizontal(false)
Category MargincategoryMarginFloat8Marigin between categories as a fraction of the total space.
Item MarginitemMarginFloat8Margin between bars in a category as a fraction.

Bar Labels

NameScriptingProperty TypeDescription
Maximum Bar WidthbarMaxWidthdoubleMaximum width any single bar can be on the chart.
Show Labels?showLabelsbooleanSet to True to always display labels.
Bar Label FontbarLabelFontFontFont for the bar labels.
Label Format StylebarLabelFormatStyleint

Automatically updates the Label Format property to predetermined settings based on the provided Dataset and selected Extraction Order.

0 = Property Titles
1 = Entry Titles
2 = Entry Values
3 = Percentage
4 = Custom

Label FormatbarLabelFormatString

If Extract Order is set to Row:
'{0}' will use the Dataset's column names, not including the first column.
'{1}' will use each row entry under the Dataset's first column.
'{2}' will use each columns row entry, not including the first column.

If Extract Order is set to Column:
'{0}' will use the row entries in the Dataset's first column.
'{1}' will use each column names in the Dataset, not including the first column.
'{2}' will use each column's row entries, not including the first column.

Regardless of Extract Order setting:
'{3}' will use a percent, based on the amount of space each bar takes up relative to its group.
A combination of formats may be entered, such as 'Name: {0}; Value={1}'.
Anything else will be printed as a string literal on each bar.

Bar Label AdjustmentbarLabelAdjustmentint

Sets the behavior of bar labels if it does not fit inside a bar.

0 = None (labels will be drawn as is)
1 = Move Over (labels that don't fit will be moved to the bar's edge)
2 = Always Move Over (labels are always moved to the bar's edge)
3 = Truncate Label (labels will be truncated with ellipses to fit inside the bar)
4= Truncate First, then Move Over (truncation will be attempted first, as in 'Truncate Label', but if it still won't fit then it will be moved to the bar's edge as in 'Move Over').

Include Offsets When Truncating?truncateWithOffsetbooleanSet to True if Bar Label Offsets should be considered when truncating labels on the chart.
Bar Label X-OffsetbarLabelOffsetXdoubleX offset between the bar and the bar label.
Bar Label Y-OffsetbarLabelOffsetYdoubleY offset between the bar and the bar label.
Bar Label AnglebarLabelAngledoubleDegrees to rotate bar labels.

Axes

NameScriptingProperty TypeDescription
Show Category Axis LabelsshowCategoryAxisLabelsbooleanSet to True to show the labels for each category axis.
Show Value Axis LabelsshowValueAxisLabelsbooleanSet to True to show the labels for each value axis.
Value Axis LabelvalueLabelStringLabel for the value axis.
Value Axis Label FormatvalueLabelFormatStringLabel format for the value axis.
Category Axis LabelcategoryLabelStringLabel for the category axis.
Value Axis Auto-RangevalAxisAutoRangebooleanIf true, the value axis range will be determined automatically. If false, the specified upper and lower bounds will be used.
Value Axis Lower BoundvalAxisLowerBounddoubleLower bound of the value axis. Used only when auto-range is false.
Value Axis Upper BoundvalAxisUpperBounddoubleUpper bound of the value axis. Used only when auto-range is false.
Category Axis Label Angle


Title FonttitleFontFontFont for the chart's title.
Legend FontlegendFontFontFont for the legend items.
Value Axis Label FontvalAxisLabelFontFontFont for the value axis label.
Category Axis Label FontcatAxisLabelFontFontFont for the category axis label.
Value Axis Tick FontvalAxisTickFontFontFont for the value axis' ticks.
Category Axis Tick FontcatAxisTickFontFontFont for the category axis' ticks.
Bar Label ColorbarLabelColorColorColor for the bar labels.
Value Axis Label ColorvalAxisLabelColorColorColor for the value axis label.
Category Axis Label ColorcatAxisLabelColorColorColor for the category axis label.
Value Axis Tick ColorvalAxisTickColorColorColor for the value axis' ticks.
Category Axis Tick ColorcatAxisTickColorColorColor for the category axis' ticks.
Value Axis Upper MarginvalAxisUpperMargindoubleUpper margin, as a percentage, of the value axis. Only used when auto-range is true.
Category Axis Upper MargincatAxisUpperMargindoubleUpper margin, as a percentage, of the category axis.
Category Axis Lower MargincatAxisLowerMargindoubleLower margin, as a percentage, of the category axis.

Event Handlers

Event handlers provide the ability to add custom script when a user interacts with a component such as by clicking a mouse, selecting drill down menu or when a component property changes.

drillDown

drillDown

Is fired when drill down menu item is selected. Excludes the "Back" menu item.

PropertyDescription
.sourceThe component that fired this event.
.drillDownNameText of selected drill down option menu item.
.categoryValue of first column for the selected row.

back

PropertyDescription
.sourceThe component that fired this event.
.drillDownNameText of selected drill down option menu item.
.categoryValue of first column for the selected row.

mouse

mouseClicked

This event signifies a mouse click on the source component. A mouse click the combination of a mouse press and a mouse release, both of which must have occurred over the source component. Note that this event fires after the pressed and released events have fired.

PropertyDescription
.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Ctrl key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.

mouseEntered

This event fires when the mouse enters the space over the source component.

PropertyDescription
.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Ctrl key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.

mouseExited

This event fires when the mouse leaves the space over the source component.

PropertyDescription
.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Ctrl key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.

mousePressed

This event fires when a mouse button is pressed down on the source component.

PropertyDescription
.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Ctrl key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.

mouseReleased

This event fires when a mouse button is released, if that mouse button's press happened over this component.

PropertyDescription
.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Ctrl key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.

mouseMotion

mouseDragged

Fires when the mouse moves over a component after a button has been pushed.


PropertyDescription
.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Ctrl key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.

mouseMoved

Fires when the mouse moves over a component, but no buttons are pushed.

PropertyDescription
.sourceThe component that fired this event.
.buttonThe code for the button that caused this event to fire.
.clickCountThe number of mouse clicks associated with this event.
.xThe x-coordinate (with respect to the source component) of this mouse event.
.yThe y-coordinate (with respect to the source component) of this mouse event.
.popupTriggerReturns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists.
.altDownTrue (1) if the Alt key was held down during this event, false (0) otherwise.
.controlDownTrue (1) if the Ctrl key was held down during this event, false (0) otherwise.
.shiftDownTrue (1) if the Shift key was held down during this event, false (0) otherwise.

propertyChange

propertyChange

Fires whenever a bindable property of the source component changes. This works for standard and custom (dynamic) properties.

PropertyDescription
.sourceThe component that fired this event.
.newValueThe new value that this property changed to.
.oldValueThe value that this property was before it changed. Note that not all components include an accurate oldValue in their events.
.propertyNameThe name of the property that changed. NOTE: Remember to always filter out these events for the property that you are looking for! Components often have many properties that change.

Extension Functions

.configureChart()

Included in Sepasoft Versions:

Warning

Stable Release Versions:

MES 3.81.1 SP9 and later
MES 3.79.0 SP9 and later

configureChart()

    • Description

Provides an opportunity to perform further chart configuration via scripting. Doesn't return anything.

    • Parameters

Component chart-A JFreeChart object. Refer to the JFreeChart documentation for API details.

    • Return

Nothing

    • Scope

Client


Custom Methods

Custom methods allow you to add your own component functions to a component that can be called through scripting. This is a useful and clean method of re-using script that is specific to the component (say you want to update a visual aspect of the component in the same way whether a user clicks on the component or a window property value changes). See Component Custom Methods in the Ignition Help Manual for more information.


Customizers

This component does not have any custom properties.


Component Functions

This component does not have functions associated with it.

Sepasoft MES Module Suite