yAxis

defines the vertical axis

object yAxis;

Example

webix.ui({
    view:"chart",
    ...
    yAxis:{
        start:-10,
        end:10,
        step:2,
        title:"Sales"
    },
    origin:0
});

Related samples

Details

The property is applicable only to bar, line, area, scatter, radar charts.
All the attributes are optional.


Available set of attributes depends on the chart type:

If attributes end, start, step are not set, they will be automatically calculated.
However, you may control the minimum value of the scale by using the origin property. For example, if you set origin:0, the scale will start from '0', even if the minimum value in the dataset is greater.

'template' attribute. Function definition

As a function, 'template' is called for each scale item of the chart and takes the item numeric value as a parameter.

template: function(value){
    return value%10 ? "" : value;
}

'lines' attribute. Function definition

Function definition allows you to manipulate the visibility of lines: to hide/show them depending on the specified rules. We recommend to use such a definition in case you have a lot of items, to prevent the chart from looking overloaded.

As a function, 'lines' is called for each scale item of the chart and takes the item index as a parameter. Must return the true(show the line) or false(hide the line) value.

lines: function(index){
    return index%2 ? false : true; // hides even lines
}

'lineColor' attribute. Function definition

Function definition allows you have different lines in different colors.

As a function, 'lineColor' is called for each scale item of the chart and takes the item index as a parameter. Must return string with the desired color.

lineColor: function(index){
    return index%2 ? "#e9eef9" : "#f3f7ff"; // colors odd and even lines in different colors
}

'bg' attribute. Function definition

As a function, 'bg' is called for each scale item of the chart and takes 2 parameters: the yAxis item index and the xAxis item index.

bg: function(yIndex, xIndex){
    return yIndex%2 ? "#e9eef9" : "#f3f7ff";
}
See also
Back to top
If you have not checked yet, be sure to visit site of our main product Webix lightweight js framework and page of javascript graph visualization product.