DevExtreme v26.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

Vue Range Selector - Embedded Chart

This demo demonstrates the ability of the RangeSelector to show the Chart component with multiple series as a background view.

Backend API
<template> <DxRangeSelector id="range-selector" :data-source="dataSource" v-model:value="range" title="Select a Range in the Costs and Revenues History" > <DxMargin :top="50"/> <DxScale> <DxMinorTickInterval :days="1"/> <DxTickInterval :days="7"/> </DxScale> <DxChart> <DxSeries argument-field="t" value-field="costs" /> <DxSeries argument-field="t" value-field="income" /> <DxValueAxis :min="0"/> </DxChart> </DxRangeSelector> </template> <script setup lang="ts"> import { reactive } from 'vue'; import { DxRangeSelector, DxMargin, DxScale, DxTickInterval, DxMinorTickInterval, DxChart, DxSeries, DxValueAxis, } from 'devextreme-vue/range-selector'; import { dataSource } from './data.ts'; const range = reactive([new Date(2024, 11, 25), new Date(2025, 0, 1)]); </script> <style> #range-selector { height: 310px; } </style>
export const dataSource = [ { t: new Date(2024, 11, 22), costs: 19, income: 18 }, { t: new Date(2024, 11, 29), costs: 27, income: 12 }, { t: new Date(2025, 0, 5), costs: 30, income: 5 }, { t: new Date(2025, 0, 12), costs: 26, income: 6 }, { t: new Date(2025, 0, 19), costs: 18, income: 10 }, { t: new Date(2025, 0, 26), costs: 15, income: 15 }, { t: new Date(2025, 1, 2), costs: 14, income: 21 }, { t: new Date(2025, 1, 9), costs: 14, income: 25 }, ];
import { createApp } from 'vue'; import App from './App.vue'; createApp(App).mount('#app');
<!DOCTYPE html> <html lang="en"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/26.1.5/css/dx.light.css" /> <link rel="stylesheet" type="text/css" href="./bundle.css" /> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="app"> </div> </div> <script src="bundles/vendor/vue.vendor.js"></script> <script src="./bundle.js"></script> </body> </html>