ImageMap(Width: Integer; Height: Integer; Params: String): String;
Width. Width of the area in which a tooltip can be displayed. The value is set in pixels.
Height. Height of the area in which a tooltip can be displayed. The value is set in pixels
Params. Using this parameter you can define text of the tooltip which is displayed for the series in HTML format.
The ImageMap property returns hypertext string used to form an HTML file.
This string contains advanced parameters of the series: tooltip text and the area in which this tooltip can be displayed.
To execute this example, create a regular report with the ID "Report" in the repository. Place a chart including a secondary pie chart on a report sheet. Link system assemblies to the module: Metabase, Report, Tab, Chart, Ui, Io.
Sub UserProc;
Const
PathName = "D:\";
FileName = "test";
Var
TObj: ITabObjects;
Serie: IChartSerie;
i, j: integer;
Writer: ITextWriter;
ImageMap: String;
SeInfo: IWinShellExecuteInfo;
Report: IPrxReport;
C: IChart;
Begin
Report := MetabaseClass.Active.ItemById("Report").Bind As IPrxReport;
Writer := File.OpenTextWriter(PathName + FileName + ".html", True);
Writer.WriteLnString("<html>");
Writer.WriteLnString("<body>");
TObj := (Report.ActiveSheet As IPrxTable).TabSheet.Objects;
For j := 0 To TObj.Count - 1 Do
If TObj.Item(j).ClassId <> "PrxChart" Then
Continue;
End If;
C := TObj.Item(j) As IChart;
C.SaveImageToFile(PathName + FileName + j.ToString + ".png", 800, 600, 96);
ImageMap := "";
For i := 0 To C.Series.Count - 1 Do
Serie := C.Series.Item(i);
ImageMap := ImageMap + Serie.ImageMap(800, 600, "title=""" + "Series name: " + Serie.Name + """");
If C.Type = ChartType.SecondaryCircles Then
ImageMap := ImageMap + C.CircleInfoEx.ImageMap(800, 600, "title=""" + C.CircleInfoEx.GroupName + """");
End If;
End For;
If ImageMap <> "" Then
Writer.WriteLnString("<map name=""test" + j.ToString + """>");
Writer.WriteLnString(ImageMap);
Writer.WriteLnString("</map>");
End If;
Writer.WriteLnString("<img border=""1"" src=""" + FileName + j.ToString + ".png"" width=800 height=600 usemap=""#test" + j.ToString + """>");
End For;
Writer.WriteLnString("</body>");
Writer.WriteLnString("</html>");
Writer.Flush;
Writer := Null;
SeInfo := New WinShellExecuteInfo.Create;
SeInfo.Directory := PathName;
SeInfo.File := PathName + FileName + ".html";
SeInfo.WaitToTerminate := False;
WinApplication.ShellExecute(SeInfo);
End Sub UserProc;
After executing the example the created HTML file opens. Hovering over a chart series opens the tooltip.
See also: