etY - downing[1], 2) > 4) {
                        return;
                    }
                    drawing = !drawing;
                    $('#pens span')[0].innerHTML = !!drawing ? 'draw' : 'free';
                    downing = null;
                });
                chart.on('mousemove', function (params) {
                    if (!drawing) {
                        return;
                    }

                    var dataIndex = params.dataIndex;
                    var value = params.value;
     