Browse Source

full size and mobile

HuJK 4 years ago
parent
commit
7dc498aa4c
2 changed files with 27 additions and 5 deletions
  1. 14 3
      chart.html
  2. 13 2
      chart_linear.html

+ 14 - 3
chart.html

@@ -10,12 +10,21 @@
                 -moz-user-select: none;
                 -webkit-user-select: none;
                 -ms-user-select: none;
+                flex-grow: 1;
+                min-height: 0;
+                width: 100%;
+                height:100%;
         }
-        </style>
+        div {
+                width:100%;
+                height:100%;
+        }
+
+	</style>
 </head>
 
 <body>
-        <div style="width:75%">
+        <div>
                 <canvas id="canvas"></canvas>
         </div>
         <script>
@@ -161,7 +170,9 @@ async function mainfunc() {
 							display: true
 						}
 					}]
-				}
+				},
+		                responsive: true,
+                maintainAspectRatio: false
         }
     });
 

+ 13 - 2
chart_linear.html

@@ -10,12 +10,21 @@
                 -moz-user-select: none;
                 -webkit-user-select: none;
                 -ms-user-select: none;
+                position: relative;
+                flex-grow: 1;
+                min-height: 0;
+                width: 100%;
+                height:100%;
         }
+	div {
+		width:100%;
+		height:100%;
+	}
         </style>
 </head>
 
 <body>
-        <div style="width:75%">
+        <div>
                 <canvas id="canvas"></canvas>
         </div>
         <script>
@@ -155,7 +164,9 @@ async function mainfunc() {
 							display: true
 						}
 					}]
-				}
+				},
+		responsive: true,
+		maintainAspectRatio: false
         }
     });