Prototype图表插件 Plotr

码农软件 · 软件分类 · 报表/图表制作 · 2019-08-21 14:59:06

软件介绍

Plotr是一个基于PlotKit与MochiKit的轻量级Javascript制图库。Plotr依赖于prototype以及HTML Canvas。

Plotr 的使用相当简单,下面是Plotr的官方示例:

<div><canvas id="bars1" height="300" width="500"></canvas></div>
<script type="text/javascript">
// Define a dataset.
var dataset = {
    'myFirstDataset': [[0, 1], [1, 1], [2, 1.414], [3, 1.73], [4, 2.56]],
    'mySecondDataset': [[0, 0.3], [1, 2.67], [2, 1.34], [3, 1.73], [4, 1.9]],
    'myThirdDataset': [[0, 0.46], [1, 1.45], [2, 2.5], [3, 1.2], [4, 2.4]],
    'myFourthDataset': [[0, .86], [1, 0.83], [2, 3], [3, 1.73], [4, 0.76]],
};
// Define options.
var options = {
    // Define a padding for the canvas node
    padding: {left: 30, right: 0, top: 10, bottom: 30},
    // Background color to render.
    backgroundColor: '#d8efb0',
    // Use the predefined blue colorscheme.
    colorScheme: 'grey',
    // Render a horizontal oriented barchart.
    barOrientation: 'vertical',
    // Set the labels.
    xTicks: [
        {v:0, label:'day 1'},
        {v:1, label:'day 2'},
        {v:2, label:'day 3'},
        {v:3, label:'day 4'}
    ]
};
// Instantiate a new BarCart.
var vertical = new Plotr.BarChart('bars1',options);
// Add a dataset to it.
vertical.addDataset(dataset);
// Render it.
vertical.render();
</script>

效果如下:

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

Web Operations

Web Operations

John Allspaw、Jesse Robbins / O'Reilly Media / 2010-6-28 / USD 39.99

A web application involves many specialists, but it takes people in web ops to ensure that everything works together throughout an application's lifetime. It's the expertise you need when your start-u......一起来看看 《Web Operations》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具