webtrader-charts
Advanced tools
Comparing version 0.4.8 to 0.4.9
{ | ||
"name": "webtrader-charts", | ||
"version": "0.4.8", | ||
"version": "0.4.9", | ||
"description": "webtrader charts", | ||
@@ -5,0 +5,0 @@ "main": "dist/webtrader-charts.js", |
@@ -55,2 +55,3 @@ # webtrader-charts ![Build Status](https://travis-ci.org/binary-com/webtrader-charts.svg?branch=master) | ||
"overlays": [ ], | ||
enableMobileView: false, // default is false | ||
/* optional field timezoneOffset in minutes, see (http://api.highcharts.com/highstock/global.timezoneOffset) | ||
@@ -70,3 +71,11 @@ timezone is global in highcharts, this option will effect other charts on the page */ | ||
chart.actions.destroy(); // Destroys the chart. returns a promise. | ||
chart.actions.stopStreaming(); // Unsubcribe from the tick stream. | ||
``` | ||
### Supporting mobile (Exprimental) | ||
Pass `enableMobileView: true` to make chart mobile friendly. This option disables the navigator and shrinks the scrollbar. | ||
In mobile devices it is recommended to reduce `count: 200`, this will improve performance but do not use a smaller value because some indicators might not work properly. | ||
### Displaying trade results (Exprimental) | ||
@@ -73,0 +82,0 @@ |
@@ -22,2 +22,3 @@ /** | ||
import './charts.scss'; | ||
import './mobileview.scss'; | ||
@@ -248,2 +249,4 @@ // TODO: moemnt locale | ||
$(containerIDWithHash).data({ | ||
enableMobileView: options.enableMobileView, | ||
count: options.count, | ||
instrumentCode: options.instrumentCode, | ||
@@ -260,2 +263,3 @@ instrumentName: options.instrumentName, | ||
const container = $(containerIDWithHash); | ||
const enableMobileView = options.enableMobileView === undefined ? false : options.enableMobileView; | ||
// Create the chart | ||
@@ -280,3 +284,3 @@ $(containerIDWithHash).highcharts('StockChart', { | ||
type: options.type, | ||
count: options.count, | ||
count: options.count, | ||
instrumentName: options.instrumentName, | ||
@@ -325,3 +329,3 @@ series_compare: options.series_compare, | ||
navigator: { | ||
enabled: true, | ||
enabled: !enableMobileView, | ||
series: { | ||
@@ -377,3 +381,2 @@ id: 'navigator' | ||
credits: { href: '#', text: '' }, | ||
scrollbar: { liveRedraw: true }, | ||
rangeSelector: { enabled: false }, | ||
@@ -472,2 +475,3 @@ | ||
tooltip: { | ||
followTouchMove: false, | ||
formatter: function() { | ||
@@ -571,2 +575,4 @@ if(!current_symbol || !current_symbol.pip) { | ||
type: options.type, | ||
enableMobileView: options.enableMobileView, | ||
count: options.count, | ||
series_compare: series_compare, | ||
@@ -573,0 +579,0 @@ delayAmount: options.delayAmount, |
@@ -11,2 +11,3 @@ import $ from 'jquery'; | ||
import {chartableMarkets} from './overlayManagement.js'; | ||
import chartingRequestMap from './common/chartingRequestMap.js'; | ||
@@ -36,2 +37,5 @@ const triggerResizeEffects = (dialog) => { | ||
$parent.addClass('chart-dialog'); | ||
if (options.enableMobileView) { | ||
$parent.addClass('mobile-chart'); | ||
} | ||
dialog.appendTo($parent); | ||
@@ -83,2 +87,5 @@ var id = `webtrader-charts-dialog-${++idCounter}`; | ||
}, | ||
stopStreaming: () => { | ||
chartingRequestMap.unregister_all(`#${id}_chart`); | ||
}, | ||
refresh: () => charts.refresh(`#${id}_chart`), | ||
@@ -85,0 +92,0 @@ }, |
@@ -247,3 +247,6 @@ import $ from 'jquery'; | ||
totalYAxes--;//Excluding main chart | ||
totalYAxes--;//Excluding navigator chart | ||
// Exclude navigator, if it is enabled | ||
if (chart.navigator.navigatorEnabled) { | ||
totalYAxes--; | ||
} | ||
var heightOfEachSubWindow = Math.round(45 / totalYAxes)-5; | ||
@@ -250,0 +253,0 @@ var topForNextSubWindow = 0; |
@@ -9,3 +9,3 @@ import $ from 'jquery'; | ||
export const init = ({appId, lang = 'en', server = 'wss://ws.binaryws.com/websockets/v3'}) => { | ||
export const init = ({appId, lang = 'en', server = 'wss://frontend.binaryws.com/websockets/v3'}) => { | ||
if(!appId) { | ||
@@ -12,0 +12,0 @@ throw new Error("appId is requried"); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2399350
236
23798
111