Получить вторую ось категорий диаграммы – Aspose.Cells Cloud API Этот REST API позволяет получить вторую ось категорий диаграммы.
API GetChartSecondCategoryAxis
GET https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/charts/{chartIndex}/secondcategoryaxis
Безопасность и аутентификация
API Aspose.Cells Cloud безопасны и требуют аутентификацию на основе токена JWT .
Параметры запроса
Имя параметра
Тип
Расположение параметра (path/query)
Описание
name
string
path
Имя файла Excel, хранящегося в облаке.
sheetName
string
path
Имя рабочего листа, содержащего диаграмму.
chartIndex
integer
path
Индекс диаграммы (начиная с 0), для которой запрашивается ось.
folder
string
query
Путь к папке в хранилище, где расположен файл.
storageName
string
query
Имя хранилища Aspose Cloud для использования (необязательно).
Ответ
{
"Code" : 200 ,
"Status" : "OK" ,
"Axis" : {
"Name" : "Second Category Axis" ,
"IsVisible" : true ,
"AxisLine" : { "Style" : "Solid" , "Weight" : 1 },
"TickMarks" : "Inside" ,
"Label" : {
"Font" : { "Size" : 10 , "Color" : "#000000" },
"Format" : "General"
}
}
}
Коды HTTP-статуса
Код
Значение
Описание
200
OK
Фильтр успешно применён; ответ содержит детали операции.
400
Bad Request
Отсутствуют или недопустимы параметры (например, неподдерживаемый тип файла).
401
Unauthorized
Недействительный или отсутствующий токен JWT.
413
Payload Too Large
Загруженный файл превышает допустимый размер.
500
Internal Server Error
Непредвиденная ошибка сервера.
Как использовать API GetChartSecondCategoryAxis с SDK
Спецификация API GetChartSecondCategoryAxis
Операция GetChartSecondCategoryAxis описана в OpenAPI Specification и позволяет выполнять прямые REST-взаимодействия из веб-браузера или любого HTTP-клиента.
Вы можете использовать утилиту командной строки cURL для удобного доступа к веб-сервисам Aspose.Cells. Ниже приведён пример вызова API с помощью cURL.
Использование SDK Aspose.Cells Cloud
Использование SDK — самый быстрый способ интеграции этого API в ваш проект. SDK обрабатывают низкоуровневые детали, такие как аутентификация, построение запросов и разбор ответов, позволяя сосредоточиться на бизнес-логике. Полный список SDK Aspose.Cells Cloud доступен в репозитории GitHub .
Примеры кода ниже демонстрируют вызов операции Get Chart Second Category Axis с использованием различных SDK:
C#
using Aspose.Cells.Cloud.SDK.Api ;
using Aspose.Cells.Cloud.SDK.Model.Requests ;
// Настройка клиента API
var config = new Configuration
{
ClientId = "<your-client-id>" ,
ClientSecret = "<your-client-secret>"
};
var apiInstance = new ChartsApi ( config );
// Построение запроса
var request = new GetChartSecondCategoryAxisRequest (
name : "Sample.xlsx" ,
sheetName : "Sheet1" ,
chartIndex : 0 ,
folder : "Documents" ,
storageName : null
);
// Выполнение
var response = apiInstance . GetChartSecondCategoryAxis ( request );
Console . WriteLine ( $"Axis Name: {response.Axis.Name}" );
Java
import com.aspose.cells.cloud.api.ChartsApi ;
import com.aspose.cells.cloud.model.* ;
import com.aspose.cells.cloud.model.requests.* ;
public class GetSecondCategoryAxis {
public static void main ( String [] args ) {
// Настройка клиента API
Configuration config = new Configuration ();
config . setClientId ( "<your-client-id>" );
config . setClientSecret ( "<your-client-secret>" );
ChartsApi api = new ChartsApi ( config );
// Построение запроса
GetChartSecondCategoryAxisRequest request = new GetChartSecondCategoryAxisRequest (
"Sample.xlsx" , "Sheet1" , 0 , "Documents" , null );
// Выполнение
AxisResponse response = api . getChartSecondCategoryAxis ( request );
System . out . println ( "Axis Name: " + response . getAxis (). getName ());
}
}
PHP
<? php
use Aspose\Cells\Cloud\Sdk\Api\ChartsApi ;
use Aspose\Cells\Cloud\Sdk\Configuration ;
use Aspose\Cells\Cloud\Sdk\Model\Requests\GetChartSecondCategoryAxisRequest ;
// Настройка
$config = new Configuration ();
$config -> setClientId ( '<your-client-id>' );
$config -> setClientSecret ( '<your-client-secret>' );
$apiInstance = new ChartsApi ( $config );
$request = new GetChartSecondCategoryAxisRequest (
'Sample.xlsx' , // name
'Sheet1' , // sheetName
0 , // chartIndex
'Documents' , // folder
null // storageName
);
try {
$result = $apiInstance -> getChartSecondCategoryAxis ( $request );
echo "Axis Name: " . $result -> getAxis () -> getName ();
} catch ( Exception $e ) {
echo 'Exception when calling ChartsApi->getChartSecondCategoryAxis: ' , $e -> getMessage (), PHP_EOL ;
}
?>
Ruby
require 'aspose_cells_cloud'
# Настройка SDK
config = AsposeCellsCloud :: Configuration . new
config . client_id = '<your-client-id>'
config . client_secret = '<your-client-secret>'
api_instance = AsposeCellsCloud :: ChartsApi . new
begin
result = api_instance . get_chart_second_category_axis (
name : 'Sample.xlsx' ,
sheet_name : 'Sheet1' ,
chart_index : 0 ,
folder : 'Documents'
)
puts "Axis Name: #{ result . axis . name } "
rescue AsposeCellsCloud :: ApiError => e
puts "Exception when calling ChartsApi->get_chart_second_category_axis: #{ e } "
end
Python
import asposecellscloud
from asposecellscloud.rest import ApiException
from asposecellscloud.apis.charts_api import ChartsApi
from asposecellscloud.models import GetChartSecondCategoryAxisRequest
# Настройка клиента API
config = asposecellscloud . Configuration ()
config . client_id = '<your-client-id>'
config . client_secret = '<your-client-secret>'
api_instance = ChartsApi ( asposecellscloud . ApiClient ( config ))
request = GetChartSecondCategoryAxisRequest (
name = 'Sample.xlsx' ,
sheet_name = 'Sheet1' ,
chart_index = 0 ,
folder = 'Documents'
)
try :
response = api_instance . get_chart_second_category_axis ( request )
print ( 'Axis Name:' , response . axis . name )
except ApiException as e :
print ( 'Exception when calling ChartsApi->get_chart_second_category_axis:' , e )
Node.js
// Пример для Node.js с использованием SDK Aspose.Cells Cloud
const { ChartsApi , Configuration } = require ( 'asposecellscloud' );
const config = new Configuration ({
clientId : '<your-client-id>' ,
clientSecret : '<your-client-secret>'
});
const api = new ChartsApi ( config );
( async () => {
try {
const response = await api . getChartSecondCategoryAxis ({
name : 'Sample.xlsx' ,
sheetName : 'Sheet1' ,
chartIndex : 0 ,
folder : 'Documents'
});
console . log ( 'Axis Name:' , response . axis . name );
} catch ( error ) {
console . error ( 'Error:' , error );
}
})();
Android
// Пример для Android (Java) с использованием SDK Aspose.Cells Cloud для Android
import com.aspose.cells.cloud.sdk.api.ChartsApi ;
import com.aspose.cells.cloud.sdk.model.* ;
import com.aspose.cells.cloud.sdk.model.requests.* ;
public class GetSecondCategoryAxisAndroid {
public void execute () {
Configuration config = new Configuration ();
config . setClientId ( "<your-client-id>" );
config . setClientSecret ( "<your-client-secret>" );
ChartsApi api = new ChartsApi ( config );
GetChartSecondCategoryAxisRequest request = new GetChartSecondCategoryAxisRequest (
"Sample.xlsx" , "Sheet1" , 0 , "Documents" , null );
try {
AxisResponse response = api . getChartSecondCategoryAxis ( request );
System . out . println ( "Axis Name: " + response . getAxis (). getName ());
} catch ( Exception e ) {
e . printStackTrace ();
}
}
}
Swift
import AsposeCellsCloud
let config = Configuration ( clientId : "<your-client-id>" , clientSecret : "<your-client-secret>" )
let api = ChartsApi ( configuration : config )
let request = GetChartSecondCategoryAxisRequest (
name : "Sample.xlsx" ,
sheetName : "Sheet1" ,
chartIndex : 0 ,
folder : "Documents" ,
storageName : nil
)
api . getChartSecondCategoryAxis ( request : request ) { result , error in
if let axis = result ?. axis {
print ( "Axis Name: \( axis . name ?? "" ) " )
} else if let err = error {
print ( "Error: \( err ) " )
}
}
Perl
use Aspose::Cells::Cloud::Sdk::Api::ChartsApi ;
use Aspose::Cells::Cloud::Sdk::Configuration ;
my $config = Aspose::Cells::Cloud::Sdk::Configuration -> new (
client_id => '<your-client-id>' ,
client_secret => '<your-client-secret>'
);
my $api = Aspose::Cells::Cloud::Sdk::Api::ChartsApi -> new ( $config );
my $response = $api -> get_chart_second_category_axis (
name => 'Sample.xlsx' ,
sheet_name => 'Sheet1' ,
chart_index => 0 ,
folder => 'Documents'
);
print "Axis Name: " . $response -> axis -> name . "\n" ;
Go
package main
import (
"fmt"
"github.com/aspose-cells-cloud/aspose-cells-cloud-go/v3"
"github.com/aspose-cells-cloud/aspose-cells-cloud-go/v3/api"
)
func main () {
cfg := asposecellscloud . NewConfiguration ()
cfg . ClientId = "<your-client-id>"
cfg . ClientSecret = "<your-client-secret>"
apiInstance := api . NewChartsApi ( cfg )
request := asposecellscloud . GetChartSecondCategoryAxisRequest {
Name : "Sample.xlsx" ,
SheetName : "Sheet1" ,
ChartIndex : 0 ,
Folder : "Documents" ,
StorageName : nil ,
}
result , _ , err := apiInstance . GetChartSecondCategoryAxis ( request )
if err != nil {
fmt . Println ( "Error:" , err )
return
}
fmt . Println ( "Axis Name:" , result . Axis . Name )
}