Bitmap: IGxBitmap;
The Bitmap property determines the image to be used as a legend element marker.
Before setting an image, you should determine a custom marker type using the IVZSizeLegendMarker.Marker property that is set to the Custom value of the VisualizatorSizeMarkerShape enumeration.
NOTE. To change legend element marker, use the IVZResourceImage.ResourceId or IVZResourceImage.Bitmap property.
Executing the example requires that the repository contains an express report with the EXPRESS identifier. A data source and the Bubble Tree visualizer should be selected in express report to display data. The root of the C disk should contain the Icon_big.ico and Icon_small.ico icons that will be used as legend markers.
Add links to the Drawing, Express, Metabase, Visualizators system assemblies.
Sub UserProc;
Var
Metabase: IMetabase;
Analyzer: IEaxAnalyzer;
BubbleTree: IVZBubbleTree;
SizeLegend: IVZSizeLegend;
LegendMarker: IVZSizeLegendMarker;
BigImage, SmallImage: IVZResourceImage;
Begin
// Get repository
Metabase := MetabaseClass.Active;
// Get express report
Analyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get bubble tree
BubbleTree := Analyzer.BubbleTree.BubbleTree;
// Get size scale
SizeLegend := BubbleTree.Legends.Item(1) As IVZSizeLegend;
// Get legend markers
LegendMarker := SizeLegend.Marker;
// Set markers
LegendMarker.BigImage := New VZResourceImage.Create;
LegendMarker.SmallImage := New VZResourceImage.Create;
LegendMarker.Marker := VisualizatorSizeMarkerShape.Custom;
// Set maximum value icon
BigImage := LegendMarker.BigImage;
BigImage.Bitmap := New GxBitmap.CreateFromFile("C:\Icon_big.ico");
// Set minimum value icon
SmallImage := LegendMarker.SmallImage;
SmallImage.Bitmap := New GxBitmap.CreateFromFile("C:\Icon_small.ico");
// Save changes to express report
(Analyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example, bubble tree size legend icons will be replaced with the Icon_big.ico and Icon_small.ico custom icons in the express report.
See also: