Update Chart Value Axis (POST /valueaxis)
Summary:
Modify the value axis of a specific chart in an Excel workbook stored in Aspose Cloud. You can set bounds, tick units, logarithmic scaling and other axis properties in a single request.
Prerequisites
JWT access token – obtain a token as described in the Authentication guide .
The target workbook must already be uploaded to Aspose Cloud storage (or the default storage).
Know the worksheet name and the zero‑based chart index you wish to modify.
Endpoint
POST https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/charts/{chartIndex}/valueaxis
Replace the placeholders with your actual values.
Placeholder
Description
{name}
Name of the Excel file (e.g., Book1.xlsx).
{sheetName}
Worksheet that contains the chart (e.g., Sheet1).
{chartIndex}
Zero‑based index of the chart (e.g., 0).
Authentication
The API uses JWT token‑based authentication . Include the token in the Authorization header:
Authorization: Bearer <jwt token>
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication .
Request Parameters
Name
Location
Type
Required
Description
name
Path
string
Yes
Excel file name stored in the cloud.
sheetName
Path
string
Yes
Worksheet that holds the chart.
chartIndex
Path
int
Yes
Zero‑based index of the chart to update.
axis
Body
object
Yes
Axis settings (see Request Body Schema ).
folder
Query
string
No
Cloud folder path where the file resides.
storageName
Query
string
No
Name of the storage service to use.
Request Body Schema (axis object)
Only the properties you need to change have to be present.
Property
Type
Required
Description
minimum
number
No
Lower bound of the axis.
maximum
number
No
Upper bound of the axis.
majorUnit
number
No
Interval between major tick marks.
minorUnit
number
No
Interval between minor tick marks.
logBase
number
No
Base of the logarithm when isLogarithmic is true.
isLogarithmic
boolean
No
Whether the axis uses a logarithmic scale.
displayUnit
string
No
Unit label displayed on the axis (e.g., "Thousands").
tickMark
string
No
Style of tick marks ("inside", "outside", etc.).
crossAt
number
No
Position where the axis crosses the perpendicular axis.
Example Request Body
{
"minimum" : 0 ,
"maximum" : 200 ,
"majorUnit" : 20 ,
"minorUnit" : 5 ,
"logBase" : 10 ,
"isLogarithmic" : false ,
"displayUnit" : "Units" ,
"tickMark" : "inside" ,
"crossAt" : 0
}
Example Requests
cURL
curl -v "https://api.aspose.cloud/v3.0/cells/<code class=\"placeholder\">{name}</code>/worksheets/<code class=\"placeholder\">{sheetName}</code>/charts/<code class=\"placeholder\">{chartIndex}</code>/valueaxis?folder=<code class=\"placeholder\">{folder}</code>&storageName=<code class=\"placeholder\">{storageName}</code>" \
-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,
"displayUnit": "Units",
"tickMark": "inside",
"crossAt": 0
}'
SDK Samples
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 ,
DisplayUnit = "Units" ,
TickMark = "inside" ,
CrossAt = 0
};
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 )
. displayUnit ( "Units" )
. tickMark ( "inside" )
. crossAt ( 0 . 0 );
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 ,
'displayUnit' => 'Units' ,
'tickMark' => 'inside' ,
'crossAt' => 0
]);
$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 ,
displayUnit : 'Units' ,
tickMark : 'inside' ,
crossAt : 0
)
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 ,
displayUnit = 'Units' ,
tickMark = 'inside' ,
crossAt = 0
)
api . post_chart_value_axis ( 'Book1.xlsx' , 'Sheet1' , 0 , axis )
print ( 'Value axis updated.' )
Node.js
// Node.js example
const { ChartsApi , Axis } = require ( 'asposecellscloud' );
const api = new ChartsApi ( 'client_id' , 'client_secret' );
const axis = new Axis ({
minimum : 0 ,
maximum : 200 ,
majorUnit : 20 ,
minorUnit : 5 ,
logBase : 10 ,
isLogarithmic : false ,
displayUnit : 'Units' ,
tickMark : 'inside' ,
crossAt : 0
});
api . postChartValueAxis ( 'Book1.xlsx' , 'Sheet1' , 0 , axis )
. then ( response => console . log ( 'Value axis updated.' ))
. catch ( err => console . error ( err ));
Android
// Android (Java) example
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 )
. displayUnit ( "Units" )
. tickMark ( "inside" )
. crossAt ( 0 . 0 );
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
axis . displayUnit = "Units"
axis . tickMark = "inside"
axis . crossAt = 0
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 ,
displayUnit => 'Units' ,
tickMark => 'inside' ,
crossAt => 0
);
$api -> postChartValueAxis ( 'Book1.xlsx' , 'Sheet1' , 0 , $axis );
print "Value axis updated.\n" ;
Go
package main
import (
"context"
"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 ,
DisplayUnit : "Units" ,
TickMark : "inside" ,
CrossAt : 0 ,
}
_ , err := client . ChartsApi . PostChartValueAxis ( context . Background (), "Book1.xlsx" , "Sheet1" , 0 , axis )
if err != nil {
fmt . Println ( "Error:" , err )
} else {
fmt . Println ( "Value axis updated." )
}
}
Responses
Success (200)
{
"Code" : 200 ,
"Status" : "OK"
}
The response type is CellsCloudResponse.
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.
Additional Resources
For any questions or feedback, please contact the Aspose.Cells Cloud support team.