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 - Numeric Scale

In this demo, data used to define the RangeSelector scale comes in the string type. However, there is the valueType property that specifies the actual data type of the scale. As this property is set to «numeric», the string data will be cast to the numeric type.

Backend API
<template> <DxRangeSelector id="range-selector" :data-source="dataSource" v-model:value="range" title="Select a Product Weight" > <DxMargin :top="50"/> <DxChart> <DxCommonSeriesSettings type="spline" argument-field="weight" /> <DxSeries value-field="appleCost" color="#00ff00" /> <DxSeries value-field="orangeCost" color="#ffa500" /> </DxChart> <DxScale value-type="numeric"/> </DxRangeSelector> </template> <script setup lang="ts"> import { ref } from 'vue'; import { DxRangeSelector, DxMargin, DxChart, DxCommonSeriesSettings, DxSeries, DxScale, } from 'devextreme-vue/range-selector'; import { dataSource } from './data.ts'; const range = ref(['1', '2']); </script> <style> #range-selector { height: 400px; } </style>
export const dataSource = [ { weight: '1', appleCost: 3, orangeCost: 7 }, { weight: '2', appleCost: 20, orangeCost: 14 }, { weight: '3', appleCost: 21, orangeCost: 21 }, { weight: '4', appleCost: 22, orangeCost: 28 }, { weight: '5', appleCost: 25, orangeCost: 35 }, { weight: '6', appleCost: 30, orangeCost: 42 }, { weight: '7', appleCost: 35, orangeCost: 44 }, { weight: '8', appleCost: 42, orangeCost: 45 }, { weight: '9', appleCost: 49, orangeCost: 46 }, { weight: '10', appleCost: 60, orangeCost: 47 }, ];
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>