javascript 图表库 plotly.js

码农软件 · 软件分类 · 报表/图表制作 · 2019-08-19 10:11:44

软件介绍

Plotly.js 是开源的 JavaScript 图表库,它基于 d3.js 和 stack.gl 。是一个高层次的、描述性的图表库。 plotly.js 带来20种图表类型,包括 3D 图表,统计图表,和 SVG 地图。

实例代码:

Plotly.d3.csv('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv', function(err, rows){      var YEAR = 2007;      var continents = ['Asia', 'Europe', 'Africa', 'Oceania', 'Americas'];      var POP_TO_PX_SIZE = 2e5;      function unpack(rows, key) {          return rows.map(function(row) { return row[key]; });
      }      var data = continents.map(function(continent) {          var rowsFiltered = rows.filter(function(row) {              return (row.continent === continent) && (+row.year === YEAR);
          });          return {
              mode: 'markers',
              name: continent,
              x: unpack(rowsFiltered, 'lifeExp'),
              y: unpack(rowsFiltered, 'gdpPercap'),
              text: unpack(rowsFiltered, 'country'),
              marker: {
                  sizemode: 'area',
                  size: unpack(rowsFiltered, 'pop'),
                  sizeref: POP_TO_PX_SIZE
              }
          };
      });      var layout = {
          xaxis: {title: 'Life Expectancy'},
          yaxis: {title: 'GDP per Capita', type: 'log'},
          margin: {t: 20},
          hovermode: 'closest'
      };
      Plotly.plot('my-graph', data, layout, {showLink: false});
  });

本文地址:https://codercto.com/soft/d/12693.html

构建之法

构建之法

邹欣 / 人民邮电出版社 / 2014-9 / 49.00元

内容简介: 软件工程牵涉的范围很广, 同时也是一般院校的同学反映比较空洞乏味的课程。 但是软件工程的技术对于投身IT 产业的学生来说是非常重要的。作者邹欣有长达20年的一线软件开发经验,他利用业余时间在数所高校进行了长达6年的软件工程教学实践,总结出了在16周的时间内让 同学们通过 “做中学 (Learning By Doing)” 掌握实用的软件工程技术的教学计划,并得到高校师生的积极反馈......一起来看看 《构建之法》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具