Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.34 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <head>
  4. <title>
  5.   Visualización
  6. </title>
  7.  
  8. <script src="https://d3js.org/d3.v5.min.js"></script>
  9.  
  10. <script type="text/javascript" src="http://static.mentful.com/gantt-chart-d3v2.js"></script>
  11.  
  12.  
  13. <style>
  14.          #title {
  15.           font-family: american typewriter;
  16.           font-size: 2vw;
  17.           color:#AB3820;
  18.           text-align:center;
  19.           margin: auto;
  20.           line-height: 3px;
  21.           color: #AB3820;
  22.           }
  23.           #subti {
  24.           font-family: american typewriter;
  25.           font-size: 1vw;
  26.           color:#777777;
  27.           text-align:center;
  28.           background-color: #ECECEC;
  29.           }
  30.           table, th, td {
  31.           border: 0px white;
  32.           }
  33.           img {
  34.           width: 100%;
  35.           height: auto;
  36.           }
  37.           html,body,#wrapper {
  38.             width: 100%;
  39.             height: 100%;
  40.             margin: 0px;
  41.         }
  42.  
  43.         .chart {
  44.             font-family: Arial, sans-serif;
  45.             font-size: 12px;
  46.         }
  47.  
  48.         .axis path,.axis line {
  49.             fill: none;
  50.             stroke: #000;
  51.             shape-rendering: crispEdges;
  52.         }
  53.  
  54.         .bar {
  55.             fill: #33b5e5;
  56.         }
  57.  
  58.         .bar-failed {
  59.             fill: #CC0000;
  60.         }
  61.  
  62.         .bar-running {
  63.             fill: #669900;
  64.         }
  65.  
  66.         .bar-succeeded {
  67.             fill: #33b5e5;
  68.         }
  69.  
  70.         .bar-killed {
  71.             fill: #ffbb33;
  72.         }
  73.  
  74.         #forkme_banner {
  75.             display: block;
  76.             position: absolute;
  77.             top: 0;
  78.             right: 10px;
  79.             z-index: 10;
  80.             padding: 10px 50px 10px 10px;
  81.             color: #fff;
  82.             background:
  83.                 url('http://dk8996.github.io/Gantt-Chart/images/blacktocat.png')
  84.                 #0090ff no-repeat 95% 50%;
  85.             font-weight: 700;
  86.             box-shadow: 0 0 10px rgba(0, 0, 0, .5);
  87.             border-bottom-left-radius: 2px;
  88.             border-bottom-right-radius: 2px;
  89.             text-decoration: none;
  90.         }
  91. </style>
  92.  
  93. </head>
  94. <body>
  95.  
  96. <div id="title">
  97. <h1><p>#Visualización<p/>
  98. </h1>
  99. </div>
  100. <br>
  101. <script type="text/javascript">
  102.  
  103. var tasks =[
  104.  {
  105.    "startDate": new Date("Sun Dec 09 00:00:00 EST 2012"),"endDate": new Date("Sun Dec 09 00:00:03 EST 2012"),"taskName": "Imagen","status": "RED"},
  106.  {
  107.    "startDate": new Date("Sun Dec 09 00:00:20 EST 2012"),"endDate": new Date("Sun Dec 09 00:00:29 EST 2012"),"taskName": "Imagen","status": "RED"},
  108.  {
  109.    "startDate": new Date("Sun Dec 09 00:00:49 EST 2012"),"endDate": new Date("Sun Dec 09 00:00:57 EST 2012"),"taskName": "Imagen","status": "RED"},
  110.  {
  111.    "startDate": new Date("Sun Dec 09 00:01:30 EST 2012"),"endDate": new Date("Sun Dec 09 00:01:32 EST 2012"),"taskName": "Imagen","status": "RED"},
  112.  {
  113.    "startDate": new Date("Sun Dec 09 00:02:06 EST 2012"),"endDate": new Date("Sun Dec 09 00:02:08 EST 2012"),"taskName": "Imagen","status": "RED"},
  114. ];
  115. var taskStatus = {
  116.     "RED" : "bar",
  117. };
  118.  
  119. var taskNames = [ "Imagen" ];
  120.  
  121. tasks.sort(function(a, b) {
  122.     return a.endDate - b.endDate;
  123. });
  124. var maxDate = tasks[tasks.length - 1].endDate;
  125. tasks.sort(function(a, b) {
  126.     return a.startDate - b.startDate;
  127. });
  128. var minDate = tasks[0].startDate;
  129.  
  130. var format = "%H:%M";
  131.  
  132. var gantt = d3.gantt().taskTypes(taskNames).taskStatus(taskStatus).tickFormat(format);gantt(tasks);
  133.  
  134.  
  135.  
  136. </script>
  137.  
  138. </script>
  139.  
  140. </body>
  141. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement