New to Kendo UI for jQuery? Start a free 30-day trial

CategoryAxis.select

configuration

The selected axis range. If configured, axis selection will be enabled.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2012/01/01"), close: 300, volume: 40000 },
            { date: new Date("2012/01/02"), close: 310, volume: 50000 },
            { date: new Date("2012/01/03"), close: 320, volume: 45000 },
            { date: new Date("2012/01/04"), close: 330, volume: 55000 },
            { date: new Date("2012/01/05"), close: 340, volume: 60000 }
        ]
    },
    dateField: "date",
    categoryAxis: {
        select: {
            from: new Date("2012/01/02"),
            to: new Date("2012/01/04")
        }
    },
    series: [{
        type: "candlestick",
        field: "close"
    }]
});
</script>

The lower boundary of the selected range.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2012/01/01"), close: 300, volume: 40000 },
            { date: new Date("2012/01/02"), close: 310, volume: 50000 },
            { date: new Date("2012/01/03"), close: 320, volume: 45000 },
            { date: new Date("2012/01/04"), close: 330, volume: 55000 },
            { date: new Date("2012/01/05"), close: 340, volume: 60000 }
        ]
    },
    dateField: "date",
    categoryAxis: {
        select: {
            from: new Date("2012/01/02")
        }
    },
    series: [{
        type: "candlestick",
        field: "close"
    }]
});
</script>

The maximum value that is selectable by the user.

Note: The category with the specified index (date) is not included in the selected range unless the axis is justified. In order to select all categories specify a value larger than the last category index (date).

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2012/01/01"), close: 300, volume: 40000 },
            { date: new Date("2012/01/02"), close: 310, volume: 50000 },
            { date: new Date("2012/01/03"), close: 320, volume: 45000 },
            { date: new Date("2012/01/04"), close: 330, volume: 55000 },
            { date: new Date("2012/01/05"), close: 340, volume: 60000 }
        ]
    },
    dateField: "date",
    categoryAxis: {
        select: {
            max: new Date("2012/01/05")
        }
    },
    series: [{
        type: "candlestick",
        field: "close"
    }]
});
</script>

The minimum value that is selectable by the user.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2012/01/01"), close: 300, volume: 40000 },
            { date: new Date("2012/01/02"), close: 310, volume: 50000 },
            { date: new Date("2012/01/03"), close: 320, volume: 45000 },
            { date: new Date("2012/01/04"), close: 330, volume: 55000 },
            { date: new Date("2012/01/05"), close: 340, volume: 60000 }
        ]
    },
    dateField: "date",
    categoryAxis: {
        select: {
            min: new Date("2012/01/01")
        }
    },
    series: [{
        type: "candlestick",
        field: "close"
    }]
});
</script>

Mousewheel zoom settings for the selection.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2012/01/01"), close: 300, volume: 40000 },
            { date: new Date("2012/01/02"), close: 310, volume: 50000 },
            { date: new Date("2012/01/03"), close: 320, volume: 45000 },
            { date: new Date("2012/01/04"), close: 330, volume: 55000 },
            { date: new Date("2012/01/05"), close: 340, volume: 60000 }
        ]
    },
    dateField: "date",
    categoryAxis: {
        select: {
            mousewheel: {
                reverse: false,
                zoom: "both"
            }
        }
    },
    series: [{
        type: "candlestick",
        field: "close"
    }]
});
</script>

The upper boundary of the selected range.

Note: The category with the specified date is not included in the selected range unless the axis is justified. In order to select all categories specify a value larger than the last category date.

<div id="stock-chart"></div>
<script>
$("#stock-chart").kendoStockChart({
    dataSource: {
        data: [
            { date: new Date("2012/01/01"), close: 300, volume: 40000 },
            { date: new Date("2012/01/02"), close: 310, volume: 50000 },
            { date: new Date("2012/01/03"), close: 320, volume: 45000 },
            { date: new Date("2012/01/04"), close: 330, volume: 55000 },
            { date: new Date("2012/01/05"), close: 340, volume: 60000 }
        ]
    },
    dateField: "date",
    categoryAxis: {
        select: {
            to: new Date("2012/01/04")
        }
    },
    series: [{
        type: "candlestick",
        field: "close"
    }]
});
</script>