четверг, 24 декабря 2020 г.

Stock Charts on stockcharts.com

https://stockcharts.com/

https://school.stockcharts.com/doku.php

https://school.stockcharts.com/doku.php?id=chart_analysis

https://school.stockcharts.com/doku.php?id=technical_indicators

https://stockcharts.com/h-sc/ui?s=%24SPX

Canvas: github. Core, Html5, Canvas, Code

 https://github.com/corehtml5canvas/code

Canvas, Examples

 1. Canvas

https://www.youtube.com/watch?v=ib9y6uJr6PQ

D:\VC\TypeScript\Train\canvas\rxjs-youtube-course

localhost:4200

npm run start

















2.Axis

https://usefulangle.com/post/19/html5-canvas-tutorial-how-to-draw-graphical-coordinate-system-with-grids-and-axis

file:///D:/VC/TypeScript/Canvas/Axis/graph.html

graph.html + index.js


















3. DrawGrid

ile:///D:/VC/TypeScript/Canvas/Axis/graph.html

graph.html + drawgrid.js





воскресенье, 13 декабря 2020 г.

React, Stockcharts

https://rrag.github.io/react-stockcharts/index.html

https://rrag.github.io/react-stockcharts/documentation.html

https://bl.ocks.org/rrag/b993d5fcc5c09dd66a6e

https://github.com/rrag/react-stockcharts/issues/206

https://codesandbox.io/s/github/rrag/react-stockcharts-examples2/tree/master/examples/CandleStickChartWithZoomPan?file=/src/utils.js

Canvas, CandleStick, Chart, Example

 https://codesandbox.io/s/j795rj77l5?file=/src/index.js

Canvas, Tutorials

 https://www.html5canvastutorials.com/

Canvas, Frameworks

https://www.sitepoint.com/best-javascript-charting-libraries/

https://canvasjs.com/

https://www.highcharts.com/

https://www.amcharts.com/

https://www.html5canvastutorials.com/

http://kineticjs.com/

http://www.html5canvastutorials.com/category/kineticjs/

https://createjs.com/easeljs

https://threejs.org/


Canvas, Prototype, Examples

Green Lesson11

 TP = {};

            TP.init = function(){

                var self = this;

                this.canvas = document.getElementById('canvas');

                this.ctx = canvas.getContext('2d');

                this.width = canvas.width;

                this.height = canvas.height;

                this.shapeList = [];

                this.animId = null;


                canvas.onclick = function(e){

                    var square = new TP.Square(

                        e.layerX, e.layerY, 40, self.ctx

                    );

                    self.shapeList.push(square);

                };

                this.animate();

            }

            TP.animate = function(){

                var self = this;

                this.render();

                this.animId = requestAnimationFrame(function(){

                    self.animate();

                });

            }

            TP.play = function(){

                var self = this;

                if (!this.animId) {

                    this.animId = requestAnimationFrame(function(){

                        self.animate();

                    });

                }             

            }

            TP.pause = function(){

                cancelAnimationFrame(this.animId);

                this.animId = null;

            }

            TP.render = function(){

                this.ctx.clearRect(0, 0, this.width, this.height);

                for(var index in this.shapeList){

                    this.shapeList[index].animate();

                }

            } 

TP.Square = function(x, y, size, ctx){

                this.x = x;

                this.y = y;

                this.size = size;

                this.ctx = ctx;

                this.color = '#'+Math.floor(

                    Math.random()*16777215

                ).toString(16);

            }

            TP.Square.prototype.render = function(){

                this.ctx.beginPath();

                this.ctx.rect(

                    this.x, this.y, this.size, this.size

                );

                this.ctx.fillStyle = this.color;

                this.ctx.fill();

                this.ctx.closePath();

            }

            TP.Square.prototype.move = function(newX, newY){

                this.x = newX;

                this.y = newY;

            }

            TP.Square.prototype.animate = function(){

                this.move(this.x - 1, this.y - 1);

                this.render();

            }