首页 > 其他分享 >vis.js插值折线图

vis.js插值折线图

时间:2024-04-22 20:56:12浏览次数:21  
标签:06 var group vis groups 折线图 2014 false js

  • 代码案例
<!doctype html>
<html>
<head>
  <title>Timeline</title>
  <script type="text/javascript" src="https://unpkg.com/vis-timeline@latest/standalone/umd/vis-timeline-graph2d.min.js"></script>
  <link href="https://unpkg.com/vis-timeline@latest/styles/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
  <style type="text/css">
    body,
    html {
        font-family: sans-serif;
    }

    #visualization {
        width: 600px;
    }
  </style>
</head>
<body>    
    <div id="visualization"></div>
    
<script type="text/javascript">
    // create a dataSet with groups
    var names = ["centripetal", "chordal", "uniform", "disabled"];
    var groups = new vis.DataSet();
    groups.add({
    id: 0,
    content: names[0],
    options: {
        drawPoints: false,
        interpolation: {
        parametrization: "centripetal",
        },
    },
    });

    groups.add({
    id: 1,
    content: names[1],
    options: {
        drawPoints: false,
        interpolation: {
        parametrization: "chordal",
        },
    },
    });

    groups.add({
    id: 2,
    content: names[2],
    options: {
        drawPoints: false,
        interpolation: {
        parametrization: "uniform",
        },
    },
    });

    groups.add({
    id: 3,
    content: names[3],
    options: {
        drawPoints: { style: "circle" },
        interpolation: false,
    },
    });

    var container = document.getElementById("visualization");
    var dataset = new vis.DataSet();
    for (var i = 0; i < names.length; i++) {
    dataset.add([
        { x: "2014-06-12", y: 0, group: i },
        { x: "2014-06-13", y: 40, group: i },
        { x: "2014-06-14", y: 10, group: i },
        { x: "2014-06-15", y: 15, group: i },
        { x: "2014-06-15", y: 30, group: i },
        { x: "2014-06-17", y: 10, group: i },
        { x: "2014-06-18", y: 15, group: i },
        { x: "2014-06-19", y: 52, group: i },
        { x: "2014-06-20", y: 10, group: i },
        { x: "2014-06-21", y: 20, group: i },
    ]);
    }

    var options = {
    drawPoints: false,
    dataAxis: { visible: false },
    legend: true,
    start: "2014-06-11",
    end: "2014-06-22",
    };
    var graph2d = new vis.Graph2d(container, dataset, groups, options);

</script>
</body>
</html>
  • 效果图
点击查看详情

标签:06,var,group,vis,groups,折线图,2014,false,js
From: https://www.cnblogs.com/dogleftover/p/18151517

相关文章

  • visual studio连接linux编码
    该操作最好是在root用户下进行,请确保你的linux里已经修改过root用户的权限修改ubuntu里root用户权限Linux安装远程调试ubuntu下安装如下:sudoapt-getinstallopenssh-serverg++gdbgdbserverLinux设置远程调试ssh允许root登录默认情况安装完SSH服务并开启,root是不允......
  • three.js实现数字孪生3D仓库一期(开源)
    大家好,本文使用three.js实现了3D仓库一期项目,给出了代码,分析了关键点,感谢大家~关键词:数字孪生、three.js、Web3D、WebGL、智慧仓库、开源代码:Github我正在承接Web3D数字孪生项目,具体介绍可看承接各种Web3D业务加QQ群交流:106047770目录需求描述建模InstancedDrawLabel实现人......
  • 使用nssm在windows服务器上部署nodejs
    在Linux上,可以轻松的使用forever或者pm2来部署nodejs应用。但是在windows下就麻烦了,pm2明确的说支持Linux&MacOS,forever在windows下貌似问题多多:  另外还有一个选择就是iisnode,这个有空研究一下,今天先说下比较简单的nssm。nssm会监控你安装的node服务,如果node挂了,nssm会......
  • vis.js外部自定义折线图
    代码案例<!doctypehtml><html><head><title>Timeline</title><scripttype="text/javascript"src="https://unpkg.com/vis-timeline@latest/standalone/umd/vis-timeline-graph2d.min.js"></script>......
  • js逆向实战之微信公众平台pwd参数解密
    网址:https://mp.weixin.qq.com/分析过程调出开发者工具,切换到network模块,随便输入一个账号和密码,抓包。看到pwd参数被加密了,接下来就是去找到pwd参数的加密过程。但其实这里可以进行加密方法的猜测,密码处输入123456,抓包。相信有经验的人可以很快的反应出是个md5算法。其......
  • vis.js动态样式折线图
    代码案例<!doctypehtml><html><head><title>Timeline</title><scripttype="text/javascript"src="https://unpkg.com/vis-timeline@latest/standalone/umd/vis-timeline-graph2d.min.js"></script>......
  • vis.js两轴折线图
    代码案例<!doctypehtml><html><head><title>Timeline</title><scripttype="text/javascript"src="https://unpkg.com/vis-timeline@latest/standalone/umd/vis-timeline-graph2d.min.js"></script>......
  • vis.js标签条形图
    代码案例<!doctypehtml><html><head><title>Timeline</title><scripttype="text/javascript"src="https://unpkg.com/vis-timeline@latest/standalone/umd/vis-timeline-graph2d.min.js"></script>......
  • 原生JS 绑定右键菜单 并隐藏浏览器右键菜单
    原生JS绑定右键菜单并隐藏浏览器右键菜单//获取元素vardom=document.getElementById("box");dom.addEventListener('contextmenu',function(e){if(e.button===2){notesTitle=e.srcElement.innerText//获取点击的元素e.preventDefault();//......
  • Node.js数电票、全电票查验接口示例、发票查验、票据OCR API
    何为数电票:数电票全称为全面数字化的电子发票,是一种全新的发票形式,与传统的纸质发票具有同等的法律效力,以数字形式存在,不依赖于纸质介质,而数电票的推行旨在提高发票管理效率,降低企业成本,推动税收征管的现代化进程。发票查验的自动化和智能化管理,可以显著减少人工核对发票......