Class PoHistogram

  • All Implemented Interfaces:
    SafeDisposable
    Direct Known Subclasses:
    PoMultipleHistogram, PoSingleHistogram

    public class PoHistogram
    extends PoGraphMaster
    Abstract class for histogram representations. This class handles the start, the end, the values of the bars, the names of the bars and the bars spacing of a histogram.

    All histogram texts depend on the current miscellaneous text attributes which define the font name, line length and so on. If the method setMiscTextAttr(textAttr) is called, the current miscellaneous text attributes are defined by "textAttr". Otherwise the current miscellaneous text attributes are specified in the current inherited state (cf property node PoMiscTextAttr).

    All histogram numerical values depend on the current numerical display format. If the method setFormat(format) is called, the current numerical display format is "format". Otherwise the current numerical display format is specified in the current inherited state (cf property node PoNumericDisplayFormat).

    If coloring = DATA_MAPPING, colors of histogram bars depend on the current data mapping. If the method setDataMapping(dataMapping) is called, the current data mapping is "dataMapping". Otherwise the current data mapping is specified in the current inherited state (cf property node PoDataMapping and its derived classes). If there is no current data-mapping (i.e setDataMapping() not called and no PoDataMapping node traversed before in the scene graph), all bars get the same color which is the inherited color.

    • Field Detail

      • start

        public final SoSFVec2f start
        Define the start point of the histogram.
      • end

        public final SoSFFloat end
        Define the end point of the histogram.
      • type

        public final SoSFEnum<PoHistogram.Types> type
        Defines if the histogram is an X histogram (bars are perpendicular to the X- axis) or a Y histogram (bars are perpendicular to the Y-axis).
      • color

        public final SoMFColor color
        Color list for the histogram bars. This field is used only if coloring = COLOR_LIST. If the number of colors is less than the number of bars, all the bars get the same color which is the inherited color.
      • coloring

        public final SoSFEnum<PoHistogram.Colorings> coloring
        Specifies how the histogram bars are colored. if coloring = COLOR_LIST, the bars are colored using the color list field color, otherwise the bars are colored according to their values (see the current data mapping for the association color-value at the header description).
      • valueFontSize

        public final SoSFFloat valueFontSize
        Font size of values. if this value is less or equal to 0, the font size is fixed at 0.04. This value is a percentage of the current domain (cf PoBase description).
      • valueFontName

        public final SoSFString valueFontName
        Font name of values. If the font is equal to its default value, the font used is the font of the current miscellaneous text attributes.
      • valueAddStringVisibility

        public final SoSFBool valueAddStringVisibility
        Visibility of the string concatenated to the values.
      • valueAddString

        public final SoSFString valueAddString
        String to be concatenated.
      • nameFontSize

        public final SoSFFloat nameFontSize
        Font size of bars names. if this value is less or equal to 0, the font size is fixed at 0.04. This value is a percentage of the current domain (cf PoBase description).
      • nameFontName

        public final SoSFString nameFontName
        Font name of bars names. If the font is equal to its default value, the font used is the font of the current miscellaneous text attributes.
      • barSpaceType

        public final SoSFEnum<PoHistogram.BarSpaceTypes> barSpaceType
        Type of bar spacing. The spacing between bars modifies the thickness of the histogram bars.
      • barSpaceValue

        public final SoSFFloat barSpaceValue
        Spacing value. If barSpaceType = REL_SPACE, real_spacing = barSpaceValue * width_bar, where width_bar is the distance between the histogram origin and the end point divided by the number of main bars. If barSpaceType = FIXED_SPACE, the real spacing is equal to barSpaceValue.
    • Method Detail

      • getDataMapping

        public PbDataMapping getDataMapping()
        Gets a reference to a PbDataMapping object to the association color-value for coloring the bars.
      • setFormat

        public void setFormat​(PbNumericDisplayFormat format)
        Sets a reference to a PbNumericDisplayFormat object for the numerical display format of values of the histograms. If this method is not called (or called passing NULL as argument), this is the numerical display format defined in the current inherited state (defined with the property node PoNumericDisplayFormat) which is used.
      • setDataMapping

        public void setDataMapping​(PbDataMapping dataMapping)
        Sets a reference to a PbDataMapping object to the association color-value for coloring the bars. If this method is not called (or called passing NULL as argument), this is the data mapping defined in the current inherited state (defined with the property node PoDataMapping and its derived classes) which is used. This method is ignored if coloring = COLOR_LIST.
      • setMiscTextAttr

        public void setMiscTextAttr​(PbMiscTextAttr textAttr)
        Sets a reference to a PbMiscTextAttr for miscellaneous text attributes. If this method is not called (or called passing NULL as argument), this is the miscellaneous text attributes defined in the current inherited state (defined with the property node PoMiscTextAttr) which are used.