bool SetChartSettings(ChartId tChart, ChartSettings tArg)
tChart. Chart moniker.
tArg. Configurable chart settings.
The SetChartSettings operation changes chart settings.
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:
"Express report instance moniker"!Chart. Express report chart (if the express report consists of a single sheet).
"Express report instance moniker"!Sheets!"Sheet key"!Chart. Chart of the selected express report sheet (if the express report consists of several sheets).
"Workbook instance moniker"!Chart. Workbook chart (if the workbook consists of a single sheet).
"Workbook instance moniker"!Sheets!"Sheet key"!Chart. Chart of specified workbook sheet (if the workbook consists of several sheets).
"Regular report instance moniker"!Sheets!"Sheet key"!Objects!"Chart identifier". Chart positioned on a regular report sheet.
The operation results in the logical True if the settings were applied successfully.
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.
{
"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"
}
}
}
}
{
"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: