GoJS is a JavaScript library that you can use to implement interactive charts. This page will show you the essentials of using GoJS. If you want to add charts and graphs, use this open source library.
GoJS has a model view architecture where models hold arrays of JavaScript objects that describe nodes and links. To visualize this data using actual Node and Link objects, the chart acts as a view.
Building a chart with GoJS creates an HTML5 Canvas element to be placed inside a given DIV element.
To start using GoJS, you need to declare the library in your HTML document. This way you also need to load the library. Load the GoJS library go.js.
To add, link to the GoJS library, which you can get from CDNJS. Alternatively, you can download the GoJS library if needed.
Here's how to add it using CDNJS -
<script src="https://cdnjs.cloudflare.com/ajax/libs/gojs/1.7.20/go-debug.js"></script>
Note: Load go-debug.js when developing for runtime error checking. When deploying, select "go.js".
The above is the detailed content of How to draw charts and graphs using GoJS HTML5 Canvas library?. For more information, please follow other related articles on the PHP Chinese website!