bool SetPrxMetaChart(string mon, PrxMetaChart tArg)
mon. Moniker for working with a chart.
tArg. Metadata that should be set for a chart.
The SetPrxMetaChart operation changes metadata of the chart located on a regular report sheet.
To execute the operation, in the mon field specify the regular report instance moniker with the !Sheets!sheet key!Objects!chart identifier postfix to work with a chart, and in the tArg field specify the metadata to be set. Moniker of regular report instance can be obtained on executing the OpenPrxMeta operation.
The operation returns true if the metadata was changed successfully.
Below is the example of changing chart settings. The request contains chart moniker and updated metadata containing necessary settings. The response contains whether changes are applied successfully.
{
"SetPrxMetaChart" :
{
"mon" : "S1!M!S!P1!Sheets!1!Objects!PrxChart3",
"tArg" :
{
"name" : "Indicators chart",
"data" : "H14:N17",
"points" : "H13:N13",
"series" : "G14:G17",
"seriesInRows" : "true",
"chartSettings" :
{
"type" : "1",
"uzs" : "true",
"bd" :
{
"enabled" : "true",
"s" : "1",
"w" : "2",
"cdef" : "true"
}
}
}
}
}
{
"SetPrxMetaChartResult" : "1"
}
public static bool ChangePrxChart(string moniker, string sheetKey, string chartId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetPrxMetaChart()
{
tArg = new PrxMetaChart()
{
chartSettings = new ChartSettings()
{
uzs = true,
type = 1,
bd = new ChartBorderSettings()
{
enabled = true,
cdef = true,
s = 1,
w = 2
}
},
name = "Indicators chart",
data = "H14:N17",
points = "H13:N13",
series = "G14:G17",
seriesInRows = true,
},
mon = moniker + "!Sheets!" + sheetKey + "!Objects!" + chartId
};
//Change chart settings
var result = somClient.SetPrxMetaChart(tSet);
return result;
}
See also: