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 the user can determine text of the tooltip, which is displayed for the series in HTML format.
The ImageMap property returns hypertext string that is used to form an HTML file.
The string contains advanced parameters of the series: tooltip text and the area, in which this tooltip can be displayed.
To execute the example, create a regular report with the Report identifier in the repository. Place a chart including a secondary pie chart on a report sheet. Add links to the Metabase, Report, Tab, Chart, Ui, Io system assemblies in the unit.
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 a tooltip.
See also: