SetPrxMetaChart

Syntax

bool SetPrxMetaChart(string mon, PrxMetaChart tArg)

Parameters

mon. Moniker for working with a chart.

tArg. Metadata that should be set for a chart.

Description

The SetPrxMetaChart operation changes metadata of the chart located on a regular report sheet.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetPrxMetaChart xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">S1!M!S!P1!Sheets!1!Objects!PrxChart3</mon>
<tArg xmlns="">
  <name>Indicators chart</name>
  <data>H14:N17</data>
  <points>H13:N13</points>
  <series>G14:G17</series>
  <seriesInRows>true</seriesInRows>
<chartSettings>
  <type>1</type>
  <uzs>true</uzs>
<bd>
  <enabled>true</enabled>
  <s>1</s>
  <w>2</w>
  <cdef>true</cdef>
  </bd>
  </chartSettings>
  </tArg>
  </SetPrxMetaChart>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SetPrxMetaChartResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">1</SetPrxMetaChartResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"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"
}
}
}
}
}

JSON response:

{
"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:

Working with Regular Reports