• Demos
    • JavaScript Charts
    • JavaScript StockCharts
  • Download/NPM
    • Download CanvasJS
    • Install via NPM
  • Integrations
    Front End Technology Samples
    • React Charts
    • Angular Charts
    • Vue.js Charts New!
    • jQuery Charts
    • Dashboards
    Server Side Technology Samples
    • PHP Charts
    • Python Charts New!
    • ASP.NET MVC Charts
    • Spring MVC Charts
    • JSP Charts
  • License
  • Blog
  • Docs
    • Chart Documentation
    • StockChart Documentation
  • Support Forum
    • Chart Support
    • StockChart Support
  • My Account
My Account
  • KEY FEATURES
    • StockChart with Numeric Axis
    • StockChart with Date-Time Axis
    • StockChart with Annotation / Indexlabel
    • StockChart with Print & Export as Image
    • Multi-Series StockChart with Navigator
    • StockChart with Async Data Loading
    • StockChart with Price & Volume
    • StockChart with Tooltip & Crosshair Syncing
    • StockChart with Combination Charts
    • Dynamic / Live StockChart
    • Dynamic / Live StockChart with StripLine
    • Stock Chart with DatePicker
  • CHART TYPES
    • StockChart with Line using JSON Data
    • StockChart with Spline Chart
    • StockChart with Area Chart
    • StockChart with Spline Area & Navigator
    • StockChart with Candlestick & Range Selector
    • StockChart with OHLC using JSON Data
    • StockChart with Range Spline Area
  • TECHNICAL INDICATORS
    • StockChart with SMA
    • StockChart with EMA
    • StockChart with MACD
    • StockChart with Technical Indicators

JavaScript StockChart with Range Spline Area & Slider

Download JavaScript StockChart Samples
  • JavaScript StockChart Samples
  • JavaScript Chart Samples
  • React Chart Samples
  • Angular Chart Samples
  • Vue.js Chart Samples
  • jQuery Chart Samples
  • PHP Chart Samples
  • Python Django Chart Samples
  • ASP.NET Chart Samples
  • JSP Chart Samples
  • Spring MVC Chart Samples
  • Dashboard Samples

Range Spline Area series are used to show range (min-max) data in a StockChart. Below example also shows setting default range of the slider. Try moving handles to update the range.

Try Editing The Code

Download Copy JSFiddle
window.onload = function () {
  var dataPoints1 = [], dataPoints2 = [];
  var stockChart = new CanvasJS.StockChart("stockChartContainer",{
    title:{
      text:"Annual Temperature"
    },
    subtitles: [{
      text: "India 1901-2017"
    }],
    charts: [{
      axisY: {
        suffix: "°C"
      },
      data: [{
        type: "rangeSplineArea",
        xValueFormatString: "YYYY",
        toolTipContent: "<span style=\"color:#4F81BC\">Year: {x}</span><br/>Min: {y[0]}°C,<br/> Max: {y[1]}°C",
        dataPoints : dataPoints1
      }]
    }],
    navigator: {
      data: [{
        type: "line",
        dataPoints: dataPoints2
      }],
      slider: {
        minimum: new Date(1950, 00),
        maximum: new Date(1980, 00)
      }
    },
    rangeSelector: {
      buttons: [{
        label: "10Y",
        range: 10,
        rangeType: "year"
      },{
        label: "20Y",
        range: 20,
        rangeType: "year"
      },{
        label: "50Y",
        range: 50,
        rangeType: "year"
      },{
        label: "All",
        range: null,
        rangeType: "all"
      }]
    }
  });
  $.getJSON("https://canvasjs.com/data/gallery/stock-chart/weather-india.json", function(data) {
    for(var i = 0; i < data.length; i++){
      dataPoints1.push({x: new Date(data[i].year, 00, 00), y: [Number(data[i].min), Number(data[i].max)]});
      dataPoints2.push({x: new Date(data[i].year, 00, 00), y: Number(data[i].avg)});
    }
    stockChart.render();
  });
}                            

Related Customizations in StockChart

  • slider
  • slider.handleColor
  • slider.outlineColor
  • slider.maskOpacity
  • dataSeries.fillOpacity
  • dataSeries.markerType
  • Quick Links

    • Chart Docs
    • StockChart Docs
    • About Us
    • FAQs

    Server Side Technologies

    • ASP.NET MVC Charts
    • PHP Charts
    • JSP Charts
    • Spring MVC Charts

    Front Side Technologies

    • JavaScript Charts
    • jQuery Charts
    • React Charts
    • Angular Charts
    • JavaScript StockCharts

    Contact

    • Fenopix, Inc.
    • 2093 Philadelphia Pike,
    • #5678, Claymont,
    • Delaware 19703
    • United States Of America

    ©2025 Fenopix Privacy Policy Cookies Policy Careers