BCGSuite for MFC

Detailed Description

The CBCGPChartAxis implements the basic functionality of a chart axis.

Currently this functionality includes the following features:

  1. Name
    • An axis can display or hide its name
    • You can customize the appearance of Axis Name by setting its fill, outline and text colors, as well as the text font and direction
  2. Grid Lines
    • Major Grid Lines for an axis can be shown or hidden
    • Minor Grid Lines for an axis can be shown or hidden
    • The colors of Major and Minor Grid Lines can be customized
    • Major Grid Line Interlacing:
      • The space between Major Grid Lines can be filled by a distinct color (by the default it's taken from current Color Theme)
      • You can specify the first interval to fill
      • You can specify the fill step (how many intervals are skipped)
  3. Axis Line and Tick Marks
    • Customizable Major and Minor Tick Mark size
    • Major and Minor Tick Marks can be hidden or have one of the following types:
      • Cross the Axis
      • Display outside the Axis
      • Display inside the Axis
    • The outline color, size and stroke style of each Axis Line and Tick Marks can be customized
  4. Axis Labels
    • An Axis supports the following label display modes:
      • No labels
      • Labels next to axis
      • Labels low (outside plot area, near the minimum display value)
      • Labels high (outside plot area, near the maximum display value)
    • Textual labels
    • Custom format for Axis Labels
    • Custom outline, fill and text colors for axis labels as well as custom font size and direction.
    • You can completely customize label drawing by overriding several virtual methods
  5. Date/Time Mode
    • The X axis can be set to the "date" mode. In this mode it treats the X component from related series as date/time values, calculates the Major Unit and formats the labels accordingly.
  6. Display Data between Tick Marks
    • This mode can be turned on if the series X component is missing and/or automatically treated as a category index. In this case X coordinates of data points are "shifted" right on half major unit size. This mode is a default for Column and Bar series.
  7. Automatic and Manual Scaling
    • It's possible to specify a fixed Major Unit for an axis
    • You can specify a custom number of Minor Units
    • Axes support a fixed grid size. In this mode you specify the distance between major grid lines in pixels and how many Data Points should be displayed within this interval. It's usable when you create real time charts and/or enable History Mode for series.
  8. Fixed Display Range
    • You can specify a fixed display range for an axis and it will automatically calculate the required scale.
    • You can specify a fixed Maximum Display Value separately.
    • You can specify a fixed Minimum Display Value separately.
  9. Cross Type
    • It's possible to specify where an Axis crosses its perpendicular axis.
    • There are four supported cross types:
      • Automatic (an axis automatically calculates the most suitable cross value based on perpendicular axis range)
      • Maximum Displayed Value
      • At Value (you can specify the cross value based on application-specific preferences)
      • Ignore (axis is displayed at its default position always)
  10. Reverse Order
    • Any Axis can display values in reverse order
  11. Axis Rotation
    • Any series type can be displayed correctly when X axis is vertical and Y axis is horizontal.
  12. Secondary Axes
    • The Chart control creates by default four axes - two primary and two secondary. The default positions for secondary axes are right (Y) and top (X) respectively. You can force to display the secondary axes even if they do not display any series.
    • Any series can be displayed on primary or secondary axes and this option can be chosen at the runtime
  13. Multiple Custom Axes
    • It's possible to create and add to a particular chart as many custom axes as you wish.
    • Each axis (including the standard primary and secondary) can be positioned within the plot area using the top and bottom (which will be right or left for horizontal axes) offsets specified in percents.
    • Any series can be assigned a pair of custom axes and thus be displayed in the specified area of the main plot area.
    • Multiple vertical axes may have one horizontal related axis (and vice versa). In this way different series having similar X component (for example, date/time) can be displayed on the same plot area separately.
  14. Zoom and Scroll
  15. Axis scale breaks.
+ Inheritance diagram for CBCGPChartAxis:

Public Member Functions

 AddScaleBreakAdds a new scale break.
 CalcMajorMinorUnitsCalculates major and minor units for an axis.
 CalcMinMaxDisplayedValuesCalled to calculate minimum and maximum displayed values.
 CalcMinMaxValuesCalled to calculate minimum and maximum values among all series displayed on axis.
 CanBeScrolledTells whether an axis can be scrolled.
 CanDisplayDataBetweenTickMarksTells whether an axis can display data points positioned between tick marks.
 CanShowScrollBarSpecifies whether an axis can display a scroll bar.
 CanUseScaleBreaksTells whether an axis can display scale breaks.
 EnableAllUnitsOnFixedIntervalSpecifies whether partially visible data points for a fixed interval width should be drawn.
 EnableIndependentZoomEnables or disables independent zoom.
 EnableMajorUnitIntervalInterlacingEnables major unit interlacing.
 EnableScaleBreaksEnables or disables axis scale breaks.
 EnableScrollEnables or disables axis scrolling.
 EnableZoomEnables or disables axis zooming.
 GenerateScaleBreaksGenerates scale breaks.
 GetAxisGapGets the distance between two axes that share the same perpendicular axis.
 GetAxisPosGets axis start and end points in client coordinates.
 GetAxisRectGets an axis rectangle.
 GetAxisSizeCalculates axis size in pixels.
 GetBottomOffsetGets axis offset from the bottom or left side of the diagram area.
 GetBoundingRectReturns bounding rectangle of this axis and its perpendicular axis.
 GetBoundingRectsReturns a list of bounding rectangles formed by this axis and its perpendicular axes.
 GetComponentIndexReturns component index of chart data this axis uses to display values.
 GetCrossValuePosReturns current cross value.
 GetCustomPerpendicularAxisReturns a pointer to custom perpendicular axis.
 GetDisplayedLabelMaps the specified value to a text label.
 GetDisplayUnitsReturns displayed units.
 GetFirstInterlacedIntervalIndexReturns first interlaced interval index.
 GetFixedIntervalWidthReturns fixed interval width.
 GetFixedIntervalWidthScaledReturns fixed interval width in device units taking into account DPI settings.
 GetIndexedSeriesReturns indexed series.
 GetInterlaceStepReturns interlace step.
 GetLabelDistanceReturns distance between axis labels and the axis line.
 GetLogScaleBaseReturns current logarithmic scale base.
 GetMajorTickMarkLenReturns size, in pixels, of major tick marks.
 GetMajorUnitReturns major axis unit.
 GetMaxDisplayedValueReturns maximum displayed value.
 GetMaxScrollValueReturns maximum scroll value.
 GetMaxZoomInFactorReturns maximal zoom factor.
 GetMinDisplayedValueReturns minimum displayed value.
 GetMinorUnitCountReturns minor unit count.
 GetMinScrollValueReturns minimum scroll value.
 GetOppositeAxisReturns a pointer to an opposite axis.
 GetPerpendecularAxisReturns a perpendicular axis.
 GetRightOffsetAsNumberOfValuesConverts offset in pixels to offset in values, taking into account the current zoom level.
 GetRightOffsetInPixelsReturns offset from the right bound of plot area in pixels.
 GetScaleBreakCountReturns a number of scale breaks.
 GetScaleBreaksOptionsReturns scale break options.
 GetScrollBarRectReturns bounding rectangle of scroll bar.
 GetSplitBottomReturns a pointer to a next split axis located at the bottom of this axis.
 GetSplitTopReturns a pointer to a next split axis located at the top of this axis.
 GetTopOffsetReturns a top offset for an axis.
 GetValuesPerIntervalReturns a number of values per interval.
 HasSeriesTells whether there is at least one series, which is displayed on an axis.
 HitTestRetrieves hit test info for an axis.
 IsAllUnitsOnFixedIntervalTells whether partially visible data points for a fixed interval width should be drawn.
 IsAlwaysShowScrollBarTells whether a scroll bar has an "always visible" flag set.
 IsAxisVisibleTells whether an axis is visible, or not.
 IsComponentXSetTells whether X component has been set for at least one series that is displayed on an axis.
 IsDisplayDataBetweenTickMarksTells whether an axis displays data between tick marks.
 IsFixedDisplayRangeTells whether an axis displays some predefined fixed range.
 IsFixedIntervalWidthTells whether an axis works in "fixed interval width" mode.
 IsFixedMajorUnitTells whether a fixed major unit is specified.
 IsFixedMaximumDisplayValueTells whether a fixed maximum displayed value has been specified.
 IsFixedMinimumDisplayValueTells whether a fixed minimum displayed value has been specified.
 IsIndependentZoomEnabledTells whether the independent zoom option is turned on or off.
 IsIndexedSeriesTells whether an axis works in "indexed" mode.
 IsLogScaleTells whether an axis has logarithmic scale.
 IsMajorGridLinesVisibleTells whether an axis displays major grid lines, or not.
 IsMajorUnitIntervalInterlacingEnabledTells whether major unit interlacing is enabled.
 IsMinorGridLinesVisibleTells whether an axis displays minor grid lines, or not.
 IsScaleBreakEnabledTells whether scale breaks feature is enabled or not.
 IsScrollEnabledTells whether an axis can be scrolled.
 IsVerticalTells whether an axis is vertical or horizontal.
 IsZoomedTells whether an axis is zoomed.
 IsZoomEnabledTells whether zoom is enabled for an axis.
 OnDrawCalled to draw an axis.
 OnDrawAxisLabelsCalled to draw axis labels.
 OnDrawAxisName3DCalled to draw axis name for 3D chart.
 OnDrawMajorGridLinesCalled to draw major grid lines.
 OnDrawMinorGridLinesCalled to draw minor grid lines.
 OnDrawScaleBreaksCalled to draw a scale break.
 OnDrawScrollBarCalled to draw a scroll bar.
 OnFillUnitIntervalsCalled to fill major unit intervals with alternative color.
 PointFromValueGiven a value in axis units calculates a point in client coordinates.
 RemoveAllBreaksRemoves all scale breaks that have been added manually.
 RemoveCustomAxisCalled for a custom axis when it's about to be removed from the chart.
 ResetResets axis state to default.
 ScrollScrolls an axis.
 ScrollToScrolls an axis to the specified value.
 SetAlwaysShowScrollBarEnables an axis to always show a scroll bar.
 SetAutoDisplayRangeSets automating display range (scaling).
 SetAutoIntervalWidthSets automatic interval width mode.
 SetAxisOffsetsSets axis offsets.
 SetCustomPerpendicularAxisSpecifies a perpendicular axis for an axis.
 SetDisplayDataBetweenTickMarksCauses data points to be displayed between tick marks.
 SetDisplayUnitsSets display units.
 SetFirstInterlacedIntervalIndexSets index of first interlaced interval.
 SetFixedDisplayRangeSets fixed display range.
 SetFixedIntervalWidthSets "fixed interval" mode.
 SetFixedMajorUnitSets fixed major unit.
 SetFixedMaximumDisplayValueSets fixed maximum displayed value.
 SetFixedMinimumDisplayValueSets fixed minimum displayed value.
 SetFixedUnitCountSets a value that fixes the number of displayed major units.
 SetIndexedSeriesSets indexed series.
 SetInterlaceStepSets interlace step value.
 SetLogScaleEnables or disables logarithmic scale for the axis.
 SetMajorTickMarkLenSets length, in pixels, of major tick marks.
 SetMaximumValueSets the maximum value on an axis.
 SetMaxZoomInFactorSets maximal zoom factor.
 SetMinAllowedMajorUnitSets minimal allowed major unit value.
 SetMinimumValueSets the minimum value on an axis.
 SetMinorTickMarkLenSets length, in pixels, of minor tick marks.
 SetMinorUnitCountSets the minor unit count.
 SetMinThumbSizeSets minimum thumb size.
 SetRightOffsetInPixelsSets offset of last displayed value in pixels for charts in "fixed interval" mode.
 SetScrollBarSizeSets scroll bar size.
 SetScrollRangeDefines a scroll range for an axis.
 SetVerticalSets axis orientation.
 ShowMajorGridLinesShows or hides major grid lines.
 ShowMinorGridLinesShows or hides minor grid lines.
 ShowScrollBarEnables an axis to display a scroll bar.
 SplitSplits an axis creating an additional custom axis.
 UnZoomSets zoom 100% on an axis.
 ValueFromPointGiven a point in client coordinates calculates corresponding axis value.
 ZoomZooms an axis.

Public Attributes

 m_axisLabelsFormatDefines appearance of axis labels.
 m_axisLabelTypeDefines location of axis labels.
 m_axisLineFormatSpecifies an axis line style.
 m_axisNameFormatDefines appearance of axis name.
 m_bAlwaysVisibleForces an axis to be visible, even it does not have any related series.
 m_bDisplayAxisNameSpecifies whether an axis name should be displayed, or not.
 m_bFormatAsDatePuts an axis to "date/time" mode.
 m_bReverseOrderTells an axis to display data in reverse order.
 m_brIntervalSpecifies alternative color for major unit interval interlacing.
 m_bVisibleSpecifies whether an axis is visible or not.
 m_crossTypeSpecifies cross type for an axis.
 m_dblCrossOtherAxisValueSpecifies a value on a perpendicular axis where this axis crosses it.
 m_dblLabelDistanceSpecifies distance between axis labels and axis line.
 m_majorGridLineFormatFormats major grid lines.
 m_majorTickMarkTypeSpecifies major tick mark type.
 m_minorGridLineFormatFormats minor grid lines.
 m_minorTickMarkTypeSpecifies minor tick mark type.
 m_nAxisIDSpecifies axis ID.
 m_nMaxTotalLinesSpecifies how many major units an axis can display.
 m_strAxisNameSpecifies axis name.
 m_strDataFormatFormats axis labels.
 m_szMaxFixedLabelSizeDeclares maximal axis label size.

Protected Member Functions

 CBCGPChartAxisConstructs and initializes a chart axis object.
 CBCGPChartAxisConstructs and initializes a chart axis object.
 OnDrawScrollBarCalled to draw a scroll bar.

Protected Attributes

 m_nMajorTickMarkLenSpecifies length of major tick marks.
 m_nMinorTickMarkLenSpecifies length of minor tick marks.