<title>Getting range based series</title>
		<meta http-equiv="content-type" content="text/html;charset=utf-8"/>	
		<script type="text/javascript" language="javascript" src="./../js/AnyChartStock.js?v=1.9.0r9317"></script>
		<!-- chart size settings -->
		<style type="text/css">
			#chartContainer {
				width: 650px;
				height: 550px;
				float: left;
		<script type="text/javascript" language="javascript">
			// Creating new chart object. 
			var chart = new AnyChartStock("./../swf/AnyChartStock.swf?v=1.9.0r9317", "./../swf/Preloader.swf?v=1.9.0r9317");
			// Setting XML config file.
			// Writing the flash object into the page DOM.
			//		Auxiliary Functions
			// Rounding
			function formatNumber(val) {
				return Math.round(val * 100) / 100;
			//		Show Values Functions
			function showInfo(showCurrent) {
				// get High value
				var highInfo = chart.getSeriesHighValue("main", "series0");
				// get Low value
				var lowInfo = chart.getSeriesLowValue("main", "series0");
				// show High value
				document.getElementById("valHigh").innerHTML = (showCurrent && highInfo.current != undefined && !isNaN(highInfo.current)) ? formatNumber(highInfo.current) : "N/A"; // current value
				document.getElementById("minHigh").innerHTML = formatNumber(highInfo.min); // minimal value
				document.getElementById("minVisibleHigh").innerHTML = formatNumber(highInfo.minVisible); // minimal visible value
				document.getElementById("maxHigh").innerHTML = formatNumber(highInfo.max); // maximal value
				document.getElementById("maxVisibleHigh").innerHTML = formatNumber(highInfo.maxVisible); // maximal visible value
				document.getElementById("firstHigh").innerHTML = formatNumber(highInfo.first); // value in the first point
				document.getElementById("firstVisibleHigh").innerHTML = formatNumber(highInfo.firstVisible); // value in the first visible point
				document.getElementById("lastHigh").innerHTML = formatNumber(highInfo.last); // value in the last point
				document.getElementById("lastVisibleHigh").innerHTML = formatNumber(highInfo.lastVisible); // value in the last visible point
				// отображение информации о Low поле серии
				document.getElementById("valLow").innerHTML = (showCurrent && lowInfo.current != undefined && !isNaN(lowInfo.current)) ? formatNumber(lowInfo.current) : "N/A"; // current value 
				document.getElementById("minLow").innerHTML = formatNumber(lowInfo.min); // minimal value
				document.getElementById("minVisibleLow").innerHTML = formatNumber(lowInfo.minVisible); // minimal visible value
				document.getElementById("maxLow").innerHTML = formatNumber(lowInfo.max); // maximal value
				document.getElementById("maxVisibleLow").innerHTML = formatNumber(lowInfo.maxVisible); // maximal visible value
				document.getElementById("firstLow").innerHTML = formatNumber(lowInfo.first); // value in the first point
				document.getElementById("firstVisibleLow").innerHTML = formatNumber(lowInfo.firstVisible); // value in the first visible point
				document.getElementById("lastLow").innerHTML = formatNumber(lowInfo.last); // value in the last point
				document.getElementById("lastVisibleLow").innerHTML = formatNumber(lowInfo.lastVisible); // value in the last visible point
			//		Events handling
			// onChartDraw event handler
			chart.onChartDraw = function() {
			// onSelectedRangeChange event handler
			chart.onSelectedRangeChange = function() {
			// onChartMouseOver event handler
			chart.onChartMouseOver = function() {
			// onChartMouseOut event handler
			chart.onChartMouseOut = function() {
			// onChartMouseMove event handler
			chart.onChartMouseMove = function() {
		<!-- style settings -->
		<style type="text/css">
			table.settings {
				border-style: solid;
				border-width: 1px;
				border-color: #D0CDC9;

			table.settings tr th {
				font:normal 60% Verdana;
				background-color: #DCD9D5;
			table.settings tr td {
				background-color: #F8F4F0;
				font:normal 70% Verdana;
		<div id="chartContainer"><!-- Chart Container --></div>
		<table class="settings">
				<th width="140">On mouse over values</th>
				<th width="70">High</th>
				<th width="70">Low</th>
				<td>Hovered Point:</td>
				<td id="valHigh"></td>
				<td id="valLow"></td>
				<th>Visible range info</th>
				<td>Min visible:</td>
				<td id="minVisibleHigh"></td>
				<td id="minVisibleLow"></td>
				<td>Max visible:</td>
				<td id="maxVisibleHigh"></td>
				<td id="maxVisibleLow"></td>
				<td>First visible:</td>
				<td id="firstVisibleHigh"></td>
				<td id="firstVisibleLow"></td>
				<td>Last visible:</td>
				<td id="lastVisibleHigh"></td>
				<td id="lastVisibleLow"></td>
				<th>Full range info</th>
				<td id="minHigh"></td>
				<td id="minLow"></td>
				<td id="maxHigh"></td>
				<td id="maxLow"></td>
				<td id="firstHigh"></td>
				<td id="firstLow"></td>
				<td id="lastHigh"></td>
				<td id="lastLow"></td>

Sample Description

How to use this sample?

Hover points and/or change selected range using any method and see point and range details in the table to the right of the chart.

to top

How it works

This sample handles onChartMouseMove, onChartMouseOut, onChartMouseOver, onChartDraw and onSelectedRangeChange events and invokes getSeriesHighValue and getSeriesLowValue methods to obtain value details.

getSeriesHighValue and getSeriesLowValue are intened to obtain values from two value series - like RangeBar or RangeArea.

To understand everything about obtaining actual chart data refer to Obtaining Actual Chart Information article.

to top

AnyChartStock JavaScript API

This sample uses the following methods, properties and events from AnyChartStock JavaScript API:

Item Type Description
getSeriesHighValue Method Gets info about "high" field of the series.
getSeriesLowValue Method Gets info about "low" field of the series.
setXMLFile Method Sets chart XML configuration file path.
write Method Adds the chart to HTML DOM as a child of the specified container.
onChartDraw Event This event is dispatched when the AnyChart Stock is drawn.
onChartMouseMove Event This event is dispatched when the mouse is moving over the chart plotting area.
onChartMouseOut Event This event is dispatched when the mouse leaves the chart plotting area.
onChartMouseOver Event This event is dispatched when the chart plotting area is hovered by the mouse.
onSelectedRangeChange Event This event is dispatched when the selected range of the chart is changed.

to top


This section lists all configuration, data and auxiliary files required for this sample.

Configuration file

CSV files

SWF files

  • AnyChartStock.swf - AnyChart Stock component.
  • Preloader.swf - AnyChart Stock helper component that loads the main component (AnyChartStock.swf) and displays loading progress.

JavaScript Libraries

  • AnyChartStock.js - A JavaScript library that is shipped with AnyChart Stock component. It is used to embed the component into HTML DOM and to comunicate with the Flash part.

to top

The information contained in this website is for general information purposes only. All sample data provided on this site is for demonstration purposes only.

The logos and names of other companies and products mentioned on this site are copyright and/or trademarks of their respective owners.

The content on this site, including news, quotes, data and other information, is provided for your personal information only, and is intended for demonstration purposes only. Content on this site is not appropriate for the purposes of making a decision to carry out a transaction or trade. Nor does it provide any form of advice (investment, tax, legal) amounting to investment advice, or make any recommendations regarding particular financial instruments, investments or products.

In no event AnyChart will be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this website.

This site may point to other Internet sites that may be of interest to you, however AnyChart does not endorse or take responsibility for the content on such other sites

Market data and News provided by and copyright RediNews, Incorporated.