You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							102 lines
						
					
					
						
							2.7 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							102 lines
						
					
					
						
							2.7 KiB
						
					
					
				| <!DOCTYPE html> | |
| <html lang="en"> | |
|   <head> | |
|     <meta charset="UTF-8" /> | |
|     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
|     <meta http-equiv="X-UA-Compatible" /> | |
|     <script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0/dist/Chart.min.js"></script> | |
|     <style> | |
|       .wrapper { | |
|         display: flex; | |
|         flex: wrap; | |
|         order: row; | |
|       } | |
|     </style> | |
|     <title>Histogram toJSON()</title> | |
|   </head> | |
|   <body> | |
|     <div style="max-width: 800px;"> | |
|       <canvas id="chart1595168308658" width="16" height="9"></canvas> | |
|     </div> | |
|     <script> | |
|       const format = num => { | |
|         const chunked = []; | |
|         String(num) | |
|           .split("") | |
|           .reverse() | |
|           .forEach((char, index) => { | |
|             if (index % 3 === 0) { | |
|               chunked.unshift([char]); | |
|             } else { | |
|               chunked[0].unshift(char); | |
|             } | |
|           }); | |
| 
 | |
|         return chunked.map(chunk => chunk.join("")).join(" "); | |
|       }; | |
|       const ctx1595168308658 = document | |
|         .getElementById("chart1595168308658") | |
|         .getContext("2d"); | |
|       const chart1595168308658 = new Chart(ctx1595168308658, { | |
|         type: "bar", | |
|         data: { | |
|           labels: ["JS 32B Histogram", "JS 32B Histogram light"], | |
|           datasets: [ | |
|             { | |
|               data: [53, 1266], | |
|               backgroundColor: [ | |
|                 "rgba(63, 142, 252, 0.8)", | |
|                 "rgba(116, 165, 127, 0.8)" | |
|               ], | |
|               borderColor: ["rgba(63, 142, 252, 1)", "rgba(116, 165, 127, 1)"], | |
|               borderWidth: 1 | |
|             } | |
|           ] | |
|         }, | |
|         options: { | |
|           legend: { | |
|             display: false | |
|           }, | |
|           title: { | |
|             display: true, | |
|             text: "Histogram toJSON()", | |
|             fontSize: 16, | |
|             padding: 20 | |
|           }, | |
|           tooltips: { | |
|             callbacks: { | |
|               label: tooltipItem => { | |
|                 return format(tooltipItem.yLabel) + " ops/s"; | |
|               } | |
|             } | |
|           }, | |
|           scales: { | |
|             yAxes: [ | |
|               { | |
|                 gridLines: { | |
|                   color: "rgba(127, 127, 127, 0.2)" | |
|                 }, | |
|                 scaleLabel: { | |
|                   display: true, | |
|                   labelString: "Operations per second" | |
|                 }, | |
|                 ticks: { | |
|                   beginAtZero: true, | |
|                   callback: format | |
|                 } | |
|               } | |
|             ], | |
|             xAxes: [ | |
|               { | |
|                 gridLines: { | |
|                   color: "rgba(127, 127, 127, 0.2)" | |
|                 }, | |
|                 maxBarThickness: 150 | |
|               } | |
|             ] | |
|           } | |
|         } | |
|       }); | |
|     </script> | |
|   </body> | |
| </html>
 |