GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Languages
  • Python (v7.1.0)
  • R
  • Julia
  • Javascript (v4.1.1)
  • ggplot2
  • MATLAB
  • F#
  • Download Studio
  • Studio and Cloud Pricing
  • Dash Enterprise Pricing
  • Getting Started
  • GitHub
  • community.plotly.com

This view

  • Original page
  • New address

GeezerVison is showing plotly.com — Getting started with plotly in Nodejs

Quick Reference
On This Page
View open positions at Plotly.

Getting started with Plotly for Nodejs

Installation

To install Plotly's Node module, use npm.

npm install plotly

Authentication

Fire up Node!

$ node
var plotly = require('plotly')("DemoAccount", "lr1c37zw81")

You'll need to replace "DemoAccount" and "lr1c37zw81" with your Plotly username and API key.

Find my API key.


Special Instructions for Chart Studio Enterprise users

Your API key for account on the public cloud will be different than the API key in Chart Studio Enterprise. Visit https://plotly.your-company.com/settings/api/ to find your Chart Studio Enterprise API key. Remember to replace "your-company.com" with the URL of your Chart Studio Enterprise server.

Instantiate your plotly object with the domain of your Chart Studio Enterprise server.

var plotly = require('plotly')({"username": "DemoAccount", "apiKey": "lr1c37zw81", "host": "plotly.your-company.com", "port": 443})

Remember to replace "your-company.com" with the URL of your Chart Studio Enterprise server. Questions? [email protected]

Start plotting!

Copy and paste the following to create your first graph using the Plotly Node library! If all goes well, the URL for your graph will be printed in your console.


var data = [{x:[0,1,2], y:[3,2,1], type: 'bar'}];
var layout = {fileopt : "overwrite", filename : "simple-node-example"};

plotly.plot(data, layout, function (err, msg) {
	if (err) return console.log(err);
	console.log(msg);
});
view examples

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.