We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Read more about our Privacy Policy and Cookie Policy
<html><head><scriptsrc="https://cdn.anychart.com/releases/v8/js/anychart-base.min.js"></script><scriptsrc="https://cdn.anychart.com/releases/v8/js/anychart-ui.min.js"></script><scriptsrc="https://cdn.anychart.com/releases/v8/js/anychart-exports.min.js"></script><scriptsrc="https://cdn.anychart.com/releases/v8/js/anychart-stock.min.js"></script><scriptsrc="https://cdn.anychart.com/releases/v8/js/anychart-data-adapter.min.js"></script><linkhref="https://cdn.anychart.com/releases/v8/css/anychart-ui.min.css"type="text/css"rel="stylesheet"><linkhref="https://cdn.anychart.com/releases/v8/fonts/css/anychart-font.min.css"type="text/css"rel="stylesheet"><styletype="text/css">html,
body,
#container{width: 100%;height: 100%;margin: 0;padding: 0;}</style></head><body><divid="container"></div><script>
anychart.onDocumentReady(function(){// The data used in this sample can be obtained from the CDN// https://cdn.anychart.com/csv-data/csco-daily.csv
anychart.data.loadCsvFile('https://cdn.anychart.com/csv-data/csco-daily.csv',function(data){// create data table on loaded datavar dataTable = anychart.data.table();
dataTable.addData(data);// map loaded data for the ohlc seriesvar mapping = dataTable.mapAs({
open:1,
high:2,
low:3,
close:4,
value:{
column:4,
type:'close'}});// map loaded data for the scrollervar scrollerMapping = dataTable.mapAs();
scrollerMapping.addField('value',5);// create stock chartvar chart = anychart.stock();// create first plot on the chartvar plot = chart.plot();
plot.yGrid(true).xGrid(true).yMinorGrid(true).xMinorGrid(true);// create candlestick seriesvar series = plot.candlestick(mapping).name('CSCO');// set legend icon type for candlestick series
series.legendItem().iconType('rising-falling');// create price channels indicatorvar priceChannels = plot.priceChannels(mapping);// set indicator's range series high and low stroke settings
priceChannels.rangeSeries().highStroke('navy');
priceChannels.rangeSeries().lowStroke('orange');// set indicator's range series fill settings
priceChannels.rangeSeries().fill('black .1');// set indicator's middle series stroke settings
priceChannels.middleSeries().stroke('green',2);// create scroller series with mapped data
chart.scroller().line(mapping);// set chart selected date/time range
chart.selectRange('2004-11-15','2005-11-16');// create range pickervar rangePicker = anychart.ui.rangePicker();// init range picker
rangePicker.render(chart);// create range selectorvar rangeSelector = anychart.ui.rangeSelector();// init range selector
rangeSelector.render(chart);// set container id for the chart
chart.container('container');// initiate chart drawing
chart.draw();});});</script></body></html>