ChartLegend GetChartLegend(LegendId tLegend)
tLegend. Chart legend moniker.
The GetChartLegend operation gets chart legend settings.
To execute the operation, in the tLegend field specify a legend moniker. The moniker can be created based on the moniker of opened object instance, which chart legend is worked with. The chart legend moniker is created based on the moniker of the repository object, which chart is worked with, following the rules:
Express report instance moniker!Chart!Legend. Express report chart legend (if express report contains one sheet).
Express report instance moniker!Sheets!Sheet key!Chart!Legend. Chart legend on the specified express report sheet (if express report contains several sheets).
Workbook instance moniker!Chart!Legend. Workbook chart legend (if workbook contains one sheet).
Workbook instance moniker!Sheets!Sheet key!Chart!Legend. Chart legend on the specified workbook sheet (if workbook contains several sheets).
Regular report instance moniker!Sheets!Sheet key!Objects!Chart identifier!Legend. Chart legend located on regular report sheet.
The operation results in legend settings.
Below is the example of getting information about the chart legend located on the regular report sheet. The request contains legend moniker. The response contains requested data.
{
"GetChartLegend" :
{
"tLegend" :
{
"id" : "S1!M!S!P1!Sheets!1!Objects!PrxChart2!Legend"
}
}
}
{
"GetChartLegendResult" :
{
"align" : "Bottom",
"font" :
{
"family" : "Tahoma",
"style" :
{
"it" : "Regular"
},
"size" :
{
"width" : "-1",
"height" : "8",
"units" : "Pt"
}
},
"fclr" : "#918F8D",
"bg" :
{
"type" : "0"
},
"bd" :
{
"enabled" : "0"
},
"sd" : "0",
"si" : "0",
"ss" :
{
"width" : "3.5",
"height" : "3.5"
},
"ap" : "1",
"ds" : "0",
"ml" : "0",
"ea" : "Center",
"mrg" :
{
"left" : "0",
"top" : "0",
"right" : "0",
"bottom" : "0"
},
"amrg" : "1"
}
}
public static ChartLegend GetChartLegend(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tGet = new GetChartLegend()
{
tLegend = new LegendId()
{
id = moniker
}
};
// Get legend settings
var result = somClient.GetChartLegend(tGet);
return result;
}
See also: