Objective Chart : PART II Programmer’s Guide : Chapter 21 Data Surveillance : Highlighting Data Items
Highlighting Data Items
Any object may be highlighted explicitly by some mechanism in the application or by the data watcher system. The normal response to highlighting is to change some visual style.
To realize this change, a copy of the object's style is taken and passed to the relevant highlighting routines for bars, wigets, and lines. This copy of the style object may be modified to give any visual style possible for the object type. Once the temporary style has been used to paint the bar, wiget, or other item; the style is discarded. This means that such highlight changes are temporary and non-destructive.
To highlight a data item, call SetHighlight() on its style member:
 
m_Graph.GetSafeData(index,group)->GetStyle()-> SetHighlight(
CX_HIGHLIGHT_MEDIUM);
The following symbols may be used with SetHighlight():
 
CX_HIGHLIGHT_NONE – no highlighting
CX_HIGHLIGHT_SMALL
CX_HIGHLIGHT_MEDIUM or CX_HIGHLIGHT_AUTOMATIC
CX_HIGHLIGHT_LARGE
CX_HIGHLIGHT_CUSTOM
The meaning of the symbols below depends on the type of object displayed.
For wigets— all highlight styles cause the wiget to be displayed at three times its normal size.
For lines— all highlight styles set the line’s width to three pixels with its color inverted. (not implemented)
For bars— all highlight styles change the bar’s frame width to three pixels and the frame color to red.
For pie wedges— the highlight styles “explode” the wedge from the pie.
CX_HIGHLIGHT_SMALL, CX_HIGHLIGHT_MEDIUM or CX_HIGHLIGHT_AUTOMATIC, and CX_HIGHLIGHT_LARGE displace the wedge by 15%, 20%, and 30% of the pie’s radius, respectively.
 
Figure 147 – Line chart with highlighted wigets
 
Figure 148 – Pie chart with a highlighted wedge
To modify this default behavior, override the appropriate functions.
 
SRGraphComponent::HighlightWigetStyle() // for wigets
SRGraphComponent::HighlightBarStyle() // for bars
SRGraphComponent::HighlightLineStyle() // for lines
SRGraphDisplay::DrawPieLabels()
SRGraphDisplay::DrawIsoPieData() // for pie wedges