Get Chart Second Category Axis – Aspose.Cells Cloud API This REST API retrieves the second‑category axis of a chart.
GetChartSecondCategoryAxis API
GET https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/charts/{chartIndex}/secondcategoryaxis
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication .
Request parameters
Parameter Name
Type
Parameter Location (path/query)
Description
name
string
path
Name of the Excel file stored in the cloud.
sheetName
string
path
Name of the worksheet that contains the chart.
chartIndex
integer
path
Zero‑based index of the chart whose axis is requested.
folder
string
query
Folder path in the storage where the file is located.
storageName
string
query
Name of the Aspose Cloud storage to use (optional).
Response
{
"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 Status Codes
Code
Meaning
Description
200
OK
Filter applied successfully; response contains operation details.
400
Bad Request
Missing or invalid parameters (e.g., unsupported file type).
401
Unauthorized
Invalid or missing JWT token.
413
Payload Too Large
Uploaded file exceeds size limit.
500
Internal Server Error
Unexpected server error.
How to Use the GetChartSecondCategoryAxis API with SDKs
GetChartSecondCategoryAxis API Specification
The Get‑Chart‑Second‑Category‑Axis operation is defined in the OpenAPI Specification and enables direct REST interactions from a web browser or any HTTP client.
You can use the cURL command‑line tool to access Aspose.Cells web services easily. The following example shows how to call the API with cURL.
Use Aspose.Cells Cloud SDKs
Using an SDK is the fastest way to integrate this API into your project. SDKs handle low‑level details such as authentication, request building, and response parsing, letting you focus on business logic. See the full list of Aspose.Cells Cloud SDKs in the GitHub repository .
The following code examples demonstrate how to call the Get Chart Second Category Axis operation with various SDKs:
C#
using Aspose.Cells.Cloud.SDK.Api ;
using Aspose.Cells.Cloud.SDK.Model.Requests ;
// Configure API client
var config = new Configuration
{
ClientId = "<your-client-id>" ,
ClientSecret = "<your-client-secret>"
};
var apiInstance = new ChartsApi ( config );
// Build request
var request = new GetChartSecondCategoryAxisRequest (
name : "Sample.xlsx" ,
sheetName : "Sheet1" ,
chartIndex : 0 ,
folder : "Documents" ,
storageName : null
);
// Execute
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 ) {
// Configure API client
Configuration config = new Configuration ();
config . setClientId ( "<your-client-id>" );
config . setClientSecret ( "<your-client-secret>" );
ChartsApi api = new ChartsApi ( config );
// Build request
GetChartSecondCategoryAxisRequest request = new GetChartSecondCategoryAxisRequest (
"Sample.xlsx" , "Sheet1" , 0 , "Documents" , null );
// Execute
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 ;
// Configure
$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'
# Configure 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
# Configure API client
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 example using the Aspose.Cells Cloud SDK
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) example using the Aspose.Cells Cloud SDK for 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 )
}