Permalink
Browse files

Initial version

  • Loading branch information...
1 parent c4b045b commit 6b146e8b0b4e8e14cf2a517a5af1a387ca793703 @davidberneda committed May 7, 2012
Showing with 5,880 additions and 0 deletions.
  1. +75 −0 README
  2. +5,670 −0 lib/teechart-min.js
  3. +45 −0 license.txt
  4. +31 −0 main.js
  5. +10 −0 node-canvas/install_node_canvas.txt
  6. +49 −0 package.json
View
75 README
@@ -0,0 +1,75 @@
+TeeChart module for Node.js
+Steema Software www.steema.com
+==============================
+
+Charting module using TeeChart for JavaScript.
+Free for non-commercial use. See license.txt.
+
+For TeeChart Javascript demos, documentation, support:
+
+http://www.steema.com/teechart/html5/
+
+Dependencies:
+-------------
+
+To create and render a chart picture at server-side,
+an HTML5 <canvas> node library is required.
+
+TeeChart has been tested on Linux using node.js and
+node-canvas module.
+
+
+Installation:
+-------------
+
+-Install node.js:
+ http://nodejs.org
+
+-Install node-canvas module:
+ http://github.com/LearnBoost/node-canvas
+
+
+Running included example:
+-------------------------
+
+# node main.js
+
+This small javascript code will accept requests via web to
+return an image/png sample chart:
+
+http://127.0.0.1:4242
+
+
+Notes:
+------
+
+The important bits of code are:
+
+1) Using TeeChart and node-canvas modules:
+
+ var tee=require('./lib/teechart-min.js'),
+ Canvas=require('./node-canvas/lib/canvas.js');
+
+2) Creating a Tee.Chart, passing the canvas:
+
+ var canvas = new Canvas(500,300),
+ chart = new tee.Tee.Chart(canvas);
+
+3) Manually specifying chart size (this step should not
+ be mandatory in future releases) :
+
+ chart.bounds.set(0,0,500,300);
+
+4) Add chart series, data, change formatting, etc, and DRAW:
+
+ chart.title.text="Node.js and TeeChart";
+ chart.addSeries(new tee.Tee.Bar([5,3,7,1,2]));
+ chart.draw();
+
+5) Return the chart as image, or save it to a file, etc
+ (Check node-canvas documentation for more options)
+
+ res.writeHead(200, {'Content-Type': 'text/html'});
+ res.end("<html><body><img src='"+canvas.toDataURL()+"'/></body></html>");
+
+
View
5,670 lib/teechart-min.js
5,670 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
45 license.txt
@@ -0,0 +1,45 @@
+TeeChart for Javascript Commercial and Non-Commercial License
+
+THE "SOFTWARE" (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF PUBLIC LICENSE ("LICENSE"). THE SOFTWARE IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE SOFTWARE PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, "STEEMA" (AS DEFINED BELOW) GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+a. "Derived Work" means an application or processable code based upon the Software, or upon the Software and other pre-existing Software, such as a translation, adaptation, derivative Software, Derived Work or any other form in which the Software may be recast, transformed, or adapted including in any form recognizably derived from or including the original.
+b. "Distribute" means to make available to the public the original and copies of the Software through sale or other transfer of ownership.
+c. "Steema" means Steema Software SL, the entity that offers the Software under the terms of this License.
+d. "Software" means the software, entitled "TeeChart for Javascript Non-Commercial Version" that includes, to the extent provided by Steema: 1) any source code files, 2) any revisions, updates and/or upgrades thereto; 3) any data, image or executable files, databases, data engines, computer software, or similar items customarily used or distributed with computer software products; 4) anything in any form whatsoever intended to be used with or in conjunction with the Software; and 5) any associated media, documentation (including physical, electronic and online) and printed materials.
+e. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Software, or who has received express permission from Steema to exercise rights under this License despite a previous violation.
+f. "Reproduce" means to make copies of the Software by any means including that of including it as part of Derived Work or in digital form or other electronic medium.
+g. "Publish" means the inclusion of the Software in any form as part of a Derived Work application or service.
+
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Steema hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Software as stated below:
+a. to Reproduce the Software or Derived Work and
+b. to Distribute and Publish the Software including as incorporated in Derived Works.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to 8(f), all rights not expressly granted by Steema are hereby reserved, including but not limited to the rights set forth in Section 4(d).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+a. You may Distribute or Publish the Software only under the terms of this License. You must include a copy of this License with every copy of the Software You Distribute or Publish. You may not offer or impose any terms on the Software that restrict the terms of this License or the ability of the recipient of the Software to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Software. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Software You Distribute or Publish. When You Distribute or Publish the Software, You may not impose any effective technological measures on the Software that restrict the ability of a recipient of the Software from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Software as incorporated in a Derived Work, but this does not require the Derived Work apart from the Software itself to be made subject to the terms of this License. If You create a Derived Work, upon notice from Steema You must, to the extent practicable, remove from the Derived Work any credit as required by Section 4(c), as requested.
+b. Unless you have received a registered commercial license authorisation from Steema you may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. Use of the Software on web pages with any profit-making purpose is considered as use for commercial advantage.
+c. If You Distribute, or Publish the Software or Derived Works, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Software and provide, reasonable to the medium or means You are utilizing: (i) the name of Steema for attribution ("Attribution Parties"); (ii) the title of the Software; (iii) to the extent reasonably practicable, the URI, if any, that Steema specifies to be associated with the Software. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of an Adaption, at a minimum such credit will appear, if a credit for all contributing authors of Adaption appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by Steema, as appropriate, of You or Your use of the Software, without the separate, express prior written permission of Steema.
+d. You may use the Software only to create Derived Works that are significantly different than the Software.
+e. For the avoidance of doubt:
+i. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, Steema reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+ii. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, Steema reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+iii. Voluntary License Schemes. Steema reserves the right to collect royalties, whether individually or, in the event that Steema is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
+f. Except as otherwise agreed in writing by Steema or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publish the Software either by itself or as part of any Derived Works, You must not distort, mutilate, modify or take other derogatory action in relation to the Software which would be prejudicial to Steema's honor or reputation.
+
+5. Representations, Warranties and Disclaimer
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, STEEMA OFFERS THE SOFTWARE AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE SOFTWARE, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL STEEMA BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE SOFTWARE, EVEN IF STEEMA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+a. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derived Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+b. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Software). Notwithstanding the above, Steema reserves the right to release the Software under different license terms or to stop distributing the Software at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+
+8. Miscellaneous
+a. Each time You Distribute or Publish the Software or a Derived Work, Steema offers to the recipient a license to the Software on the same terms and conditions as the license granted to You under this License.
+b. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+c. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+d. This License constitutes the entire agreement between the parties with respect to the Software licensed here. There are no understandings, agreements or representations with respect to the Software not specified here. Steema shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of Steema and You.
+e. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
View
31 main.js
@@ -0,0 +1,31 @@
+var tee=require('./lib/teechart-min.js'),
+ Canvas=require('./node-canvas/lib/canvas.js'),
+ http = require('http'),
+ count=0;
+
+http.createServer(function (req, res) {
+
+ var canvas = new Canvas(500,300),
+ chart = new tee.Tee.Chart(canvas);
+
+ //chart.panel.transparent = true;
+
+ chart.title.text="Node.js and TeeChart";
+ chart.addSeries(new tee.Tee.Bar([5,3,7,1,2]));
+
+ console.log("Drawing Chart");
+
+ chart.bounds.set(0,0,500,300);
+
+ chart.draw();
+
+ console.log("Sending Chart: " +(count++));
+
+ res.writeHead(200, {'Content-Type': 'text/html'});
+
+ res.end("<html><body><title>TeeChart Node.js node-canvas Example</title><img src='"+canvas.toDataURL()+"'/></body></html>");
+
+}).listen(4242, "127.0.0.1");
+
+console.log('TeeChart Server running at http://127.0.0.1:4242/');
+
View
10 node-canvas/install_node_canvas.txt
@@ -0,0 +1,10 @@
+
+TeeChart for Node.js requires a library that
+implements the HTML5 <canvas> tag.
+
+The node-canvas module has been tested under Linux.
+
+To install node-canvas, please visit:
+
+http://github.com/LearnBoost/node-canvas
+
View
49 package.json
@@ -0,0 +1,49 @@
+{
+ "author": "David Berneda <david@steema.com> (http://www.steema.com)",
+ "name": "TeeChart",
+ "description": "Charting and graphing node.js module",
+ "tags" : ["html5", "canvas", "chart", "graph", "plot", "visualization"]
+ "version": "0.0.1",
+ "keywords": [
+ "canvas",
+ "w3c",
+ "html5",
+ "chart",
+ "plot",
+ "graph",
+ "charting",
+ "2d",
+ "javascript"
+ ],
+ "homepage": "http://www.steema.com/teechart/html5",
+ "repository": {
+ "url": "TeeChart"
+ },
+ "maintainers": [
+ {
+ "name": "david berneda",
+ "email": "david@steema.com",
+ "url": "http://steema.com"
+ }
+ ],
+ "bugs" : {
+ "email": "david@steema.com",
+ "url" : "http://github.com/davidberneda/TeeChart/issues"
+ },
+ "licenses": [
+ {
+ "type": "CC",
+ "url": "http://github.com/davidberneda/TeeChart/blob/master/LICENSE.txt"
+ }
+ ],
+ "main" : "./main",
+ "scripts": { "test": "node main.js" },
+ "dependencies": {
+ "node-canvas": "0.2.x"
+ },
+ "devDependencies": {},
+ "optionalDependencies": {},
+ "engines": {
+ "node": "*"
+ }
+}

0 comments on commit 6b146e8

Please sign in to comment.