首页 > 其他分享 >vis.js本地化折线图

vis.js本地化折线图

时间:2024-04-22 21:00:23浏览次数:23  
标签:06 locale var vis 折线图 2014 js select

  • 代码案例
<!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;
    } */

    body,
    html,
    select {
        font-family: sans-serif;
        font-size: 11pt;
    }


    #visualization {
        width: 600px;
    }
  </style>
</head>
<body>    
    <p>
        <label for="locale">Select a locale:</label>
        <select id="locale">
          <option value="en" selected="">en</option>
          <option value="it">it</option>
          <option value="fr">fr</option>
          <option value="nl">nl</option>
          <option value="de">de</option>
        </select>
    </p>
    <div id="visualization"></div>
    
<script type="text/javascript">
    var container = document.getElementById("visualization");
    var items = [
    { x: "2014-06-11", y: 10 },
    { x: "2014-06-12", y: 25 },
    { x: "2014-06-13", y: 30 },
    { x: "2014-06-14", y: 10 },
    { x: "2014-06-15", y: 15 },
    { x: "2014-06-16", y: 30 },
    ];

    var dataset = new vis.DataSet(items);
    var options = {
    start: "2014-06-10",
    end: "2014-06-18",
    };
    var graph2d = new vis.Graph2d(container, dataset, options);

    // update the locale when changing the select box value
    var select = document.getElementById("locale");
    select.onchange = function () {
    graph2d.setOptions({
        locale: this.value,
    });
    };
    select.onchange();

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

标签:06,locale,var,vis,折线图,2014,js,select
From: https://www.cnblogs.com/dogleftover/p/18151533

相关文章

  • 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>......
  • 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();//......