折线散点图
| <!DOCTYPE html> |
| <html> |
| <head> |
| <link rel="stylesheet" href="./chartist.min.css"> |
| <script src="./chartist.min.js"></script> |
| </head> |
| <body> |
| <div class="ct-chart ct-perfect-fourth" style="width: 500px;height: 350px;"></div> |
| <script> |
| var times = function(n) { |
| return Array.apply(null, new Array(n)); |
| }; |
| |
| var data = times(52).map(Math.random).reduce(function(data, rnd, index) { |
| data.labels.push(index + 1); |
| data.series.forEach(function(series) { |
| series.push(Math.random() * 100) |
| }); |
| |
| return data; |
| }, { |
| labels: [], |
| series: times(4).map(function() { return new Array() }) |
| }); |
| |
| var options = { |
| showLine: false, |
| axisX: { |
| labelInterpolationFnc: function(value, index) { |
| return index % 13 === 0 ? 'W' + value : null; |
| } |
| } |
| }; |
| |
| var responsiveOptions = [ |
| ['screen and (min-width: 640px)', { |
| axisX: { |
| labelInterpolationFnc: function(value, index) { |
| return index % 4 === 0 ? 'W' + value : null; |
| } |
| } |
| }] |
| ]; |
| |
| new Chartist.Line('.ct-chart', data, options, responsiveOptions); |
| </script> |
| </body> |
| </html> |
点击查看详情

带面积折线图
| <!DOCTYPE html> |
| <html> |
| <head> |
| <link rel="stylesheet" href="./chartist.min.css"> |
| <script src="./chartist.min.js"></script> |
| </head> |
| <body> |
| <div class="ct-chart ct-perfect-fourth" style="width: 500px;height: 350px;"></div> |
| <script> |
| new Chartist.Line('.ct-chart', { |
| labels: [1, 2, 3, 4, 5, 6, 7, 8], |
| series: [ |
| [5, 9, 7, 8, 5, 3, 5, 4] |
| ] |
| }, { |
| low: 0, |
| showArea: true |
| }); |
| </script> |
| </body> |
| </html> |
点击查看详情

仅带面积的的双极折线图
| <!DOCTYPE html> |
| <html> |
| <head> |
| <link rel="stylesheet" href="./chartist.min.css"> |
| <script src="./chartist.min.js"></script> |
| </head> |
| <body> |
| <div class="ct-chart ct-perfect-fourth" style="width: 500px;height: 350px;"></div> |
| <script> |
| new Chartist.Line('.ct-chart', { |
| labels: [1, 2, 3, 4, 5, 6, 7, 8], |
| series: [ |
| [1, 2, 3, 1, -2, 0, 1, 0], |
| [-2, -1, -2, -1, -2.5, -1, -2, -1], |
| [0, 0, 0, 1, 2, 2.5, 2, 1], |
| [2.5, 2, 1, 0.5, 1, 0.5, -1, -2.5] |
| ] |
| }, { |
| high: 3, |
| low: -3, |
| showArea: true, |
| showLine: false, |
| showPoint: false, |
| fullWidth: true, |
| axisX: { |
| showLabel: false, |
| showGrid: false |
| } |
| }); |
| </script> |
| </body> |
| </html> |
点击查看详情

【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
2022-04-26 Mybatis入门(五):缓存
2022-04-26 Mybatis入门(四):动态sql
2022-04-26 idea不能识别yaml文件
2022-04-26 docker容器通讯