SetChartSettings

Syntax

bool SetChartSettings(ChartId tChart, ChartSettings tArg)

Parameters

tChart. Chart moniker.

tArg. Configurable chart settings.

Description

The SetChartSettings operation changes chart settings.

Comments

To execute the operation, specify chart moniker in the tChart field and selected settings in the tArg field.

The chart moniker is based on moniker of the repository object, with the chart of which the user is working, following the rules:

The operation results in the logical True if the settings were applied successfully.

Example

Below is the example of changing settings of the chart created in regular report. The request contains chart moniker and new settings. The response contains whether settings are changed 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">
<SetChartSettings xmlns="http://www.fsight.ru/PP.SOM.Som">
<tChart xmlns="">
  <id>S1!M!S!P1!Sheets!1!Objects!PrxChart1</id>
  </tChart>
<tArg xmlns="">
  <view3d>true</view3d>
<bg>
  <type>2</type>
<gfill>
  <cf>#00FF00</cf>
  <ct>#009900</ct>
  <tp>50</tp>
  <a>45</a>
  </gfill>
  </bg>
<bd>
  <enabled>true</enabled>
  <clr>#999999</clr>
  <s>0</s>
  <w>2</w>
  </bd>
  </tArg>
  </SetChartSettings>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SetChartSettingsResult 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</SetChartSettingsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetChartSettings" :
{
"tChart" :
{
"id" : "S1!M!S!P1!Sheets!1!Objects!PrxChart1"
},
"tArg" :
{
"view3d" : "true",
"bg" :
{
"type" : "2",
"gfill" :
{
"cf" : "#00FF00",
"ct" : "#009900",
"tp" : "50",
"a" : "45"
}
},
"bd" :
{
"enabled" : "true",
"clr" : "#999999",
"s" : "0",
"w" : "2"
}
}
}
}

JSON response:

{
"SetChartSettingsResult" : "1"
}
public static bool SetChartSettings(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetChartSettings()
{
tChart = new ChartId()
{
id = moniker
},
tArg = new ChartSettings()
{
view3d = true,
bg = new ChartBackgroundSettings()
{
type = 2,
gfill = new ChartGradientFillSettings()
{
cf = "#00FF00",
ct = "#009900",
tp = 50,
a = 45
}
},
bd = new ChartBorderSettings()
{
enabled = true,
s = 0,
clr = "#999999",
w = 2
}
}
};
// Change settings
var result = somClient.SetChartSettings(tSet);
return result;
}

See also:

Chart