ipecharts.option.singleaxis module#

class ipecharts.option.singleaxis.SingleAxis(**kwargs: Any)[source]#

Bases: BaseWidget

Warning:

Autogenerated class

An axis with a single dimension. It can be used to display data in one dimension. For example:

id Unicode(None)#

Component ID, not specified by default. If specified, it can be used to refer the component in option or API.

zlevel Float(None)#

zlevel value of all graphical elements in .

zlevel is used to make layers with Canvas. Graphical elements with different zlevel values will be placed in different Canvases, which is a common optimization technique. We can put those frequently changed elements (like those with animations) to a separate zlevel. Notice that too many Canvases will increase memory cost, and should be used carefully on mobile phones to avoid crash.

Canvases with bigger zlevel will be placed on Canvases with smaller zlevel.

z Float(None)#

z value of all graphical elements in , which controls order of drawing graphical components. Components with smaller z values may be overwritten by those with larger z values.

z has a lower priority to zlevel, and will not create new Canvas.

left Union(None)#

Distance between single component and the left side of the container.

left can be a pixel value like 20; it can also be a percentage value relative to container width like ‘20%’; and it can also be ‘left’, ‘center’, or ‘right’.

If the left value is set to be ‘left’, ‘center’, or ‘right’, then the component will be aligned automatically based on position.

top Union(None)#

Distance between single component and the top side of the container.

top can be a pixel value like 20; it can also be a percentage value relative to container width like ‘20%’; and it can also be ‘top’, ‘middle’, or ‘bottom’.

If the top value is set to be ‘top’, ‘middle’, or ‘bottom’, then the component will be aligned automatically based on position.

right Union(None)#

Distance between single component and the right side of the container.

right can be a pixel value like 20; it can also be a percentage value relative to container width like ‘20%’.

bottom Union(None)#

Distance between single component and the bottom side of the container.

bottom can be a pixel value like 20; it can also be a percentage value relative to container width like ‘20%’.

width Union(None)#

Width of single component. Adaptive by default.

height Union(None)#

Height of single component. Adaptive by default.

orient Unicode(None)#

Orientation of the axis. By default, it’s ‘horizontal’. You can set it to be ‘vertical’ to make a vertical axis.

type Unicode(None)#

Type of axis.

Option:

  • ‘value’ Numerical axis, suitable for continuous data.

  • ‘category’ Category axis, suitable for discrete category data. Category data can be auto retrieved from [series.data](#series.data) or [dataset.source](#dataset.source), or can be specified via [singleAxis.data](#singleAxis.data).

  • ‘time’ Time axis, suitable for continuous time series data. As compared to value axis, it has a better formatting for time and a different tick calculation method. For example, it decides to use month, week, day or hour for tick based on the range of span.

  • ‘log’ Log axis, suitable for log data. Stacked bar or line series with type: ‘log’ axes may lead to significant visual errors and may have unintended effects in certain circumstances. Their use should be avoided.

name Unicode(None)#

Name of axis.

nameLocation Unicode(None)#

Location of axis name.

Options:

  • ‘start’

  • ‘middle’ or ‘center’

  • ‘end’

nameTextStyle Dict()#

Text style of axis name.

nameGap Float(None)#

Gap between axis name and axis line.

nameRotate Float(None)#

Rotation of axis name.

nameTruncate Dict()#

Truncation of the axis name.

inverse Bool(None)#

Set this to true to invert the axis. This is a new option available from Echarts 3 and newer.

boundaryGap Union(None)#

The boundary gap on both sides of a coordinate axis. The setting and behavior of category axes and non-category axes are different.

The boundaryGap of category axis can be set to either true or false. Default value is set to be true, in which case [axisTick](#singleAxis.axisTick) is served only as a separation line, and labels and data appear only in the center part of two [axis ticks](#singleAxis.axisTick), which is called band.

For non-category axis, including time, numerical value, and log axes, boundaryGap is an array of two values, representing the spanning range between minimum and maximum value. The value can be set in numeric value or relative percentage, which becomes invalid after setting [min](#singleAxis.min) and [max](#singleAxis.max). Example:

``` boundaryGap: [‘20%’, ‘20%’]

```

min Union(None)#

The minimum value of axis.

It can be set to a special value ‘dataMin’ so that the minimum value on this axis is set to be the minimum label.

It will be automatically computed to make sure axis tick is equally distributed when not set.

In category axis, it can also be set as the ordinal number. For example, if a catergory axis has data: [‘categoryA’, ‘categoryB’, ‘categoryC’], and the ordinal 2 represents ‘categoryC’. Moreover, it can be set as negative number, like -3.

If min is specified as a function, it should return a min value, like:

``` min: function (value) {

return value.min - 20;

}

```

value is an object, containing the min value and max value of the data. This function should return the min value of axis, or return null/undefined to make echarts use the auto calculated min value (null/undefined return is only supported since v4.8.0).

max Union(None)#

The maximum value of axis.

It can be set to a special value ‘dataMax’ so that the minimum value on this axis is set to be the maximum label.

It will be automatically computed to make sure axis tick is equally distributed when not set.

In category axis, it can also be set as the ordinal number. For example, if a catergory axis has data: [‘categoryA’, ‘categoryB’, ‘categoryC’], and the ordinal 2 represents ‘categoryC’. Moreover, it can be set as negative number, like -3.

If max is specified as a function, it should return a max value, like:

``` max: function (value) {

return value.max - 20;

}

```

value is an object, containing the min value and max value of the data. This function should return the max value of axis, or return null/undefined to make echarts use the auto calculated max value (null/undefined return is only supported since v4.8.0).

scale Bool(None)#

It is available only in numerical axis, i.e., [type](#singleAxis.type): ‘value’.

It specifies whether not to contain zero position of axis compulsively. When it is set to be true, the axis may not contain zero position, which is useful in the scatter chart for both value axes.

This configuration item is unavailable when the [min](#singleAxis.min) and [max](#singleAxis.max) are set.

splitNumber Float(None)#

Number of segments that the axis is split into. Note that this number serves only as a recommendation, and the true segments may be adjusted based on readability.

This is unavailable for category axis.

minInterval Float(None)#

Minimum gap between split lines.

For example, it can be set to be 1 to make sure axis label is show as integer.

``` {

minInterval: 1

}

```

It is available only for axis of [type](#singleAxis.type) ‘value’ or ‘time’.

maxInterval Float(None)#

Maximum gap between split lines.

For example, in time axis ([type](#singleAxis.type) is ‘time’), it can be set to be 3600 * 24 * 1000 to make sure that the gap between axis labels is less than or equal to one day.

``` {

maxInterval: 3600 * 1000 * 24

}

```

It is available only for axis of [type](#singleAxis.type) ‘value’ or ‘time’.

interval Float(None)#

Compulsively set segmentation interval for axis.

As [splitNumber](#singleAxis.splitNumber) is a recommendation value, the calculated tick may not be the same as expected. In this case, interval should be used along with [min](#singleAxis.min) and [max](#singleAxis.max) to compulsively set tickings. But in most cases, we do not suggest using this, our automatic calculation is enough for most situations.

This is unavailable for ‘category’ and ‘time’ axes. Logged value should be passed for [type](#singleAxis.type): ‘log’ axis.

logBase Float(None)#

Base of logarithm, which is valid only for numeric axes with [type](#singleAxis.type): ‘log’.

startValue Float(None)#

> Since v5.5.1

To specify the start value of the axis.

silent Bool(None)#

Set this to true, to prevent interaction with the axis.

triggerEvent Bool(None)#

Set this to true to enable triggering events.

Parameters of the event include:

``` {

// Component type: xAxis, yAxis, radiusAxis, angleAxis // Each of which has an attribute for index, e.g., xAxisIndex for xAxis componentType: string, // Value on axis before being formatted. // Click on value label to trigger event. value: ‘’, // Name of axis. // Click on laben name to trigger event. name: ‘’

}

```

axisLine Dict()#

Settings related to axis line.

axisTick Dict()#

Settings related to axis tick.

minorTick Dict()#

> Since v4.6.0

Settings related minor ticks.

Note: minorTick is not available in the category type axis.

Examples:

  1. Using minor ticks in function plotting.

  2. Using minor ticks in log axis.

axisLabel Dict()#

Settings related to axis label.

splitLine Dict()#

Split line of axis in [grid](#grid) area.

minorSplitLine Dict()#

> Since v4.6.0

Minor split lines of axis in the [grid](#grid) area。It will align to the [minorTick](#singleAxis.minorTick)

splitArea Dict()#

Split area of axis in [grid](#grid) area, not shown by default.

data Any(None)#

Category data, available in [type](#singleAxis.type): ‘category’ axis.

If [type](#singleAxis.type) is not specified, but axis.data is specified, the [type](#singleAxis.type) is auto set as ‘category’.

If [type](#singleAxis.type) is specified as ‘category’, but axis.data is not specified, axis.data will be auto collected from [series.data](#series.data). It brings convenience, but we should notice that axis.data provides then value range of the ‘category’ axis. If it is auto collected from [series.data](#series.data), Only the values appearing in [series.data](#series.data) can be collected. For example, if [series.data](#series.data) is empty, nothing will be collected.

Example:

``` // Name list of all categories data: [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’, ‘Sunday’] // Each item could also be a specific configuration item. // In this case, value is used as the category name. data: [{

value: ‘Monday’, // Highlight Monday textStyle: {

fontSize: 20, color: ‘red’

}

}, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’, ‘Sunday’]

```

axisPointer Dict()#

axisPointer settings on the axis.

tooltip Dict()#

tooltip settings in the coordinate system component.

General Introduction:

tooltip can be configured on different places:

  • Configured on global: [tooltip](#tooltip)

  • Configured in a coordinate system: [grid.tooltip](#grid.tooltip), [polar.tooltip](#polar.tooltip), [single.tooltip](#single.tooltip)

  • Configured in a series: [series.tooltip](#series.tooltip)

  • Configured in each item of series.data: [series.data.tooltip](#series.data.tooltip)

animation Bool(None)#

Whether to enable animation.

animationThreshold Float(None)#

Whether to set graphic number threshold to animation. Animation will be disabled when graphic number is larger than threshold.

animationDuration Union(None)#

Duration of the first animation, which supports callback function for different data to have different animation effect:

``` animationDuration: function (idx) {

// delay for later data is larger return idx * 100;

}

```

animationEasing Unicode(None)#

Easing method used for the first animation. Varied easing effects can be found at [easing effect example](https://echarts.apache.org/examples/en/editor.html?c=line-easing).

animationDelay Union(None)#

Delay before updating the first animation, which supports callback function for different data to have different animation effect.

For example:

``` animationDelay: function (idx) {

// delay for later data is larger return idx * 100;

}

```

See [this example](https://echarts.apache.org/examples/en/editor.html?c=bar-animation-delay) for more information.

animationDurationUpdate Union(None)#

Time for animation to complete, which supports callback function for different data to have different animation effect:

``` animationDurationUpdate: function (idx) {

// delay for later data is larger return idx * 100;

}

```

animationEasingUpdate Unicode(None)#

Easing method used for animation.

animationDelayUpdate Union(None)#

Delay before updating animation, which supports callback function for different data to have different animation effects.

For example:

``` animationDelayUpdate: function (idx) {

// delay for later data is larger return idx * 100;

}

```

See [this example](https://echarts.apache.org/examples/en/editor.html?c=bar-animation-delay) for more information.