Aspose.Cells Cloud API – Update Chart Value Axis (POST /valueaxis) This REST API updates the chart value axis.
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication .
REST API
POST https://api.aspose.cloud/v3.0/cells/{ name} /worksheets/{ sheetName} /charts/{ chartIndex} /valueaxis
Request Parameters
Parameter Name
Type
Location
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 value axis will be updated.
axis
object
body
JSON object that defines the new value‑axis settings (e.g., minimum, maximum, majorUnit).
folder
string
query
Cloud folder path where the file is located (optional).
storageName
string
query
Name of the storage service to use (optional).
Request Body Schema (axis object)
The axis object may contain any of the following properties:
minimum (number) – Lower bound of the axis.
maximum (number) – Upper bound of the axis.
majorUnit (number) – Interval between major tick marks.
minorUnit (number) – Interval between minor tick marks.
logBase (number) – Base of the logarithm when isLogarithmic is true.
isLogarithmic (boolean) – Indicates whether the axis uses a logarithmic scale.
displayUnit (string) – Unit label displayed on the axis (e.g., "Thousands").
tickMark (string) – Style of tick marks (e.g., "inside").
crossAt (number) – Position where the axis crosses the perpendicular axis.
Only the properties you need to change have to be included in the JSON payload.
Sample Request Body
{
"minimum" : 0 ,
"maximum" : 200 ,
"majorUnit" : 20 ,
"minorUnit" : 5 ,
"logBase" : 10 ,
"isLogarithmic" : false ,
"displayUnit" : "Units" ,
"tickMark" : "inside" ,
"crossAt" : 0
}
cURL Example
curl -v "https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/charts/{chartIndex}/valueaxis" \
-X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>" \
-d '{
"minimum": 0,
"maximum": 200,
"majorUnit": 20,
"minorUnit": 5,
"logBase": 10,
"isLogarithmic": false
}'
Successful Response
{
"Code" : 200 ,
"Status" : "OK"
}
Error Responses
HTTP Status
Code
Message
400
400
Invalid request parameters or body.
401
401
Authentication failed.
404
404
Specified file, worksheet, or chart not found.
500
500
Internal server error.
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
Cloud SDK Family
Using an SDK is the best way to speed up development. An SDK handles low‑level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs:
C#
using Aspose.Cells.Cloud.SDK.Api ;
using Aspose.Cells.Cloud.SDK.Model ;
var api = new ChartsApi ( "client_id" , "client_secret" );
var axis = new Axis ()
{
Minimum = 0 ,
Maximum = 200 ,
MajorUnit = 20 ,
MinorUnit = 5 ,
LogBase = 10 ,
IsLogarithmic = false
};
var response = api . PostChartValueAxis ( "Book1.xlsx" , "Sheet1" , 0 , axis );
Console . WriteLine ( $"Status: {response.Status}" );
Java
import com.aspose.cells.cloud.api.ChartsApi ;
import com.aspose.cells.cloud.model.Axis ;
ChartsApi api = new ChartsApi ( "client_id" , "client_secret" );
Axis axis = new Axis ()
. minimum ( 0 . 0 )
. maximum ( 200 . 0 )
. majorUnit ( 20 . 0 )
. minorUnit ( 5 . 0 )
. logBase ( 10 . 0 )
. isLogarithmic ( false );
api . postChartValueAxis ( "Book1.xlsx" , "Sheet1" , 0 , axis );
System . out . println ( "Value axis updated." );
PHP
<? php
require 'vendor/autoload.php' ;
use Aspose\Cells\Cloud\Api\ChartsApi ;
use Aspose\Cells\Cloud\Model\Axis ;
$api = new ChartsApi ( 'client_id' , 'client_secret' );
$axis = new Axis ([
'minimum' => 0 ,
'maximum' => 200 ,
'majorUnit' => 20 ,
'minorUnit' => 5 ,
'logBase' => 10 ,
'isLogarithmic' => false
]);
$api -> postChartValueAxis ( 'Book1.xlsx' , 'Sheet1' , 0 , $axis );
echo "Value axis updated. \n " ;
?>
Ruby
require 'aspose_cells_cloud'
api = AsposeCellsCloud :: ChartsApi . new ( 'client_id' , 'client_secret' )
axis = AsposeCellsCloud :: Axis . new (
minimum : 0 ,
maximum : 200 ,
majorUnit : 20 ,
minorUnit : 5 ,
logBase : 10 ,
isLogarithmic : false
)
api . post_chart_value_axis ( 'Book1.xlsx' , 'Sheet1' , 0 , axis )
puts 'Value axis updated.'
Python
from asposecellscloud import ChartsApi , Axis
api = ChartsApi ( 'client_id' , 'client_secret' )
axis = Axis (
minimum = 0 ,
maximum = 200 ,
majorUnit = 20 ,
minorUnit = 5 ,
logBase = 10 ,
isLogarithmic = False
)
api . post_chart_value_axis ( 'Book1.xlsx' , 'Sheet1' , 0 , axis )
print ( 'Value axis updated.' )
Node.js
Android
// Android (Java) example using the Aspose.Cells Cloud SDK
ChartsApi api = new ChartsApi ( "client_id" , "client_secret" );
Axis axis = new Axis ()
. minimum ( 0 . 0 )
. maximum ( 200 . 0 )
. majorUnit ( 20 . 0 )
. minorUnit ( 5 . 0 )
. logBase ( 10 . 0 )
. isLogarithmic ( false );
api . postChartValueAxis ( "Book1.xlsx" , "Sheet1" , 0 , axis );
Swift
import AsposeCellsCloud
let api = ChartsApi ( clientId : "client_id" , clientSecret : "client_secret" )
var axis = Axis ()
axis . minimum = 0
axis . maximum = 200
axis . majorUnit = 20
axis . minorUnit = 5
axis . logBase = 10
axis . isLogarithmic = false
api . postChartValueAxis ( name : "Book1.xlsx" , sheetName : "Sheet1" , chartIndex : 0 , axis : axis ) { result , error in
if let error = error {
print ( "Error: \\ (error)" )
} else {
print ( "Value axis updated." )
}
}
Perl
use Aspose::Cells::Cloud::Api::ChartsApi ;
use Aspose::Cells::Cloud::Model::Axis ;
my $api = ChartsApi -> new ( 'client_id' , 'client_secret' );
my $axis = Axis -> new (
minimum => 0 ,
maximum => 200 ,
majorUnit => 20 ,
minorUnit => 5 ,
logBase => 10 ,
isLogarithmic => JSON:: false
);
$api -> postChartValueAxis ( 'Book1.xlsx' , 'Sheet1' , 0 , $axis );
print "Value axis updated.\n" ;
Go
package main
import (
"fmt"
"github.com/aspose-cells-cloud/aspose-cells-cloud-go/v2/api"
"github.com/aspose-cells-cloud/aspose-cells-cloud-go/v2/model"
)
func main () {
cfg := api . NewConfiguration ()
cfg . AddDefaultHeader ( "client_id" , "client_id" )
cfg . AddDefaultHeader ( "client_secret" , "client_secret" )
client := api . NewAPIClient ( cfg )
axis := model . Axis {
Minimum : 0 ,
Maximum : 200 ,
MajorUnit : 20 ,
MinorUnit : 5 ,
LogBase : 10 ,
IsLogarithmic : false ,
}
_ , err := client . ChartsApi . PostChartValueAxis ( context . Background (), "Book1.xlsx" , "Sheet1" , 0 , axis )
if err != nil {
fmt . Println ( "Error:" , err )
} else {
fmt . Println ( "Value axis updated." )
}
}