Your search did not match any results.
RangeSelector

Numeric Scale

Documentation

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

@model List<DevExtreme.MVC.Demos.Models.NumericScaleProduct> @(Html.DevExtreme().RangeSelector() .ID("range-selector") .DataSource(Model) .Margin(m => m.Top(50)) .Size(s => s.Height(400)) .Chart(c => c .CommonSeriesSettings(cs => cs .Type(SeriesType.Spline) .ArgumentField("Weight") ) .Series(s => { s.Add().ValueField("AppleCost").Color("#00ff00"); s.Add().ValueField("OrangeCost").Color("#ffa500"); }) ) .Scale(s => s.ValueType(ChartDataType.Numeric)) .Value(new[] { 1, 2 }) .Title("Select a Product Weight") )
using DevExtreme.AspNet.Data; using DevExtreme.AspNet.Mvc; using DevExtreme.MVC.Demos.Models.SampleData; using System.Linq; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class RangeSelectorController : Controller { public ActionResult NumericScale() { return View(SampleData.NumericScaleProducts); } } }
using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.MVC.Demos.Models { public class NumericScaleProduct { public double Weight { get; set; } public double AppleCost { get; set; } public double OrangeCost { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.MVC.Demos.Models.SampleData { public partial class SampleData { public static List<NumericScaleProduct> NumericScaleProducts = new List<NumericScaleProduct> { new NumericScaleProduct() { Weight = 1, AppleCost = 3, OrangeCost = 7 }, new NumericScaleProduct() { Weight = 2, AppleCost = 20, OrangeCost = 14 }, new NumericScaleProduct() { Weight = 3, AppleCost = 21, OrangeCost = 21 }, new NumericScaleProduct() { Weight = 4, AppleCost = 22, OrangeCost = 28 }, new NumericScaleProduct() { Weight = 5, AppleCost = 25, OrangeCost = 35 }, new NumericScaleProduct() { Weight = 6, AppleCost = 30, OrangeCost = 42 }, new NumericScaleProduct() { Weight = 7, AppleCost = 35, OrangeCost = 44 }, new NumericScaleProduct() { Weight = 8, AppleCost = 42, OrangeCost = 45 }, new NumericScaleProduct() { Weight = 9, AppleCost = 49, OrangeCost = 46 }, new NumericScaleProduct() { Weight = 10, AppleCost = 60, OrangeCost = 47 } }; } }
#range-selector { height: 440px; width: 100%; }