function createChart(container) {
  // apply theme
  anychart.theme(app.state.settings.theme || 'darkEarth');
  
  // create and tune the chart
  chart = anychart.stock();

  // set chart's settings
  chart.padding(10, 50);
  chart.title('EUR.FOREX data started from Jan 2000 and 1 minute ticker\n');
  
  const plot = chart.plot();
  plot.legend(false);

  // adding extra Y axis to the right side
  plot.yAxis(1).orientation('right');

  // add annotation items in context menu
  chart.contextMenu().itemsFormatter(contextMenuItemsFormatter);

  //create chart series with selected series
  series = plot[app.state.settings.seriesType || 'candlestick']();

  // set series name
  series.name('EUR.FOREX');

  //set mapping to the series
  series.data(mapping);

  // render the chart
  chart.container(container).draw();

  // create range selector
  const rangeSelector = anychart.ui.rangeSelector();
  // render range selector to the chart
  rangeSelector.render(chart);

  // create scroller series
  chart.scroller().area(mapping);

  // restore indicators and annotations with settings from the app state
  drawIndicators(app.state.indicators);
  drawAnnotations(app.state.annotations);

  // restore selected range
  const {min, max} = app.state.settings.currentRange || {};
  chart.selectRange(min, max, true);
}
/**
 * create chart and set it's settings
 * @param {string} container chart container
 * @param {boolean} updateChart update chart(true) or create new chart(false)
 */
create chart and set it's settings
@param {string} container chart container
@param {boolean} updateChart update chart(true) or create new chart(false)
create chart and set it ' s settings @param { string } container chart container @param { boolean } updateChart update chart ( true ) or create new chart ( false )
function createChart(container) {
  anychart.theme(app.state.settings.theme || 'darkEarth');
  chart = anychart.stock();
  chart.padding(10, 50);
  chart.title('EUR.FOREX data started from Jan 2000 and 1 minute ticker\n');
  const plot = chart.plot();
  plot.legend(false);
  plot.yAxis(1).orientation('right');
  chart.contextMenu().itemsFormatter(contextMenuItemsFormatter);
  series = plot[app.state.settings.seriesType || 'candlestick']();
  series.name('EUR.FOREX');
  series.data(mapping);
  chart.container(container).draw();
  const rangeSelector = anychart.ui.rangeSelector();
  rangeSelector.render(chart);
  chart.scroller().area(mapping);
  drawIndicators(app.state.indicators);
  drawAnnotations(app.state.annotations);
  const {min, max} = app.state.settings.currentRange || {};
  chart.selectRange(min, max, true);
}
function createChart ( container ) { anychart . theme ( app . state . settings . theme || 'darkEarth' ) ; chart = anychart . stock ( ) ; chart . padding ( 10 , 50 ) ; chart . title ( 'EUR.FOREX data started from Jan 2000 and 1 minute ticker\n' ) ; const plot = chart . plot ( ) ; plot . legend ( false ) ; plot . yAxis ( 1 ) . orientation ( 'right' ) ; chart . contextMenu ( ) . itemsFormatter ( contextMenuItemsFormatter ) ; series = plot [ app . state . settings . seriesType || 'candlestick' ] ( ) ; series . name ( 'EUR.FOREX' ) ; series . data ( mapping ) ; chart . container ( container ) . draw ( ) ; const rangeSelector = anychart . ui . rangeSelector ( ) ; rangeSelector . render ( chart ) ; chart . scroller ( ) . area ( mapping ) ; drawIndicators ( app . state . indicators ) ; drawAnnotations ( app . state . annotations ) ; const { min , max } = app . state . settings . currentRange || { } ; chart . selectRange ( min , max , true ) ; }
create chart and set it's settings
 @param {string} container chart container
 @param {boolean} updateChart update chart(true) or create new chart(false)
create chart and set it ' s settings @param { string } container chart container @param { boolean } updateChart update chart ( true ) or create new chart ( false )
// apply theme // create and tune the chart // set chart's settings // adding extra Y axis to the right side // add annotation items in context menu //create chart series with selected series // set series name //set mapping to the series // render the chart // create range selector // render range selector to the chart // create scroller series // restore indicators and annotations with settings from the app state // restore selected range