BorderPen: IGxPen;
BorderPen: Prognoz.Platform.Interop.Drawing.GxPen;
The BorderPen property determines parameters of borders of external legend.
Executing the example requires a regular report with the Report identifier. The report includes the following objects: a chart and an external legend.
Sub Main;
Var
mb: IMetabase;
rep: IPrxReport;
legend: IPrxChartLegend;
chartlegend: IChartExternLegend;
items: IChartExternLegendItems;
chartPen: IGxPen;
Begin
mb:= MetabaseClass.Active;
rep := mb.ItemById("OBJ42859").Edit As IPrxReport;
legend:= (rep.ActiveSheet As IprxTable).TabSheet.Objects.Item(1).Extension As IPrxChartLegend;
chartlegend:= legend As IChartExternLegend;
chartlegend.AxisIcon:= ChartLegendAxisIcon.Axis;
chartPen := New GxPen.CreateSolid(GxColor.FromName("Green"), 5);
chartlegend.BorderPen := chartPen;
items := chartlegend.InternalItems;
items.Swap(0,3);
(rep As IMetabaseObject).Save;
End Sub Main;
After executing the example the external legend border thickness becomes 5 mm and the color changes to green.
Executing the example requires a regular report with the Report identifier. The report includes the following objects: a chart and an external legend.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Drawing;
...
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
rep: IPrxReport;
legend: IPrxChartLegend;
chartlegend: IChartExternLegend;
items: IChartExternLegendItems;
chartBI: IChartBackgroundInfo;
color: GxColorClass_2;
chartPen: GxPenClass;
Begin
mb := Params.Metabase;
rep := mb.ItemById["OBJ42859"].Edit() As IPrxReport;
legend := (rep.ActiveSheet As IprxTable).TabSheet.Objects.Item[1].Extension As IPrxChartLegend;
chartlegend := legend As IChartExternLegend;
chartlegend.AxisIcon := ChartLegendAxisIcon.claiAxis;
chartBI := chartlegend.BackgroundInfo;
color := New GxColorClass_2();
color.CreateARGB(255, 245, 120, 255);
chartBI.Color := color;
chartBI.Type := ChartBackgroundType.cbtColor;
color.CreateRGB(0, 255, 255);
chartPen := New GxPenClass();
chartPen.CreateSolid(color, 5);
chartlegend.BorderPen := chartPen;
items := chartlegend.InternalItems;
(rep As IMetabaseObject).Save();
End Sub;
After executing the example the external legend border thickness becomes 5 mm and the color changes to green.
See also: