Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0" />
- <title>DynamicShop-Graph</title>
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
- <link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" type="text/css"
- rel="stylesheet" media="screen,projection" />
- <style>
- body {
- display: flex;
- min-height: 100vh;
- flex-direction: column;
- }
- main {
- flex: 1 0 auto;
- }
- </style>
- </head>
- <body>
- <header>
- <nav class="light-blue lighten-1" role="navigation">
- <div class="nav-wrapper container"><a id="logo-container" href="#" class="brand-logo">슈퍼라쿤서버 아이템 차트</a>
- </div>
- </nav>
- </header>
- <main>
- <div class="section no-pad-bot" id="index-banner">
- <div class="container">
- <div class="row center">
- <div class="input-field">
- <select id="data-select">
- <option value="" selected>아이템을 선택하세요</option>
- </select>
- </div>
- </div>
- <br>
- </div>
- </div>
- <div class="container">
- <div class="graphSection">
- <div id="graphContainer"></div>
- </div>
- </div>
- </main>
- <footer class="page-footer blue">
- <div class="container">
- <div class="row">
- <div class="col l6 s12">
- <p class="grey-text text-lighten-4">DynamicShop-Graph v0.2.4-custom</p>
- </div>
- <div class="col l4 offset-l2 s12">
- <ul>
- <li><a class="grey-text text-lighten-3" href="https://github.com/jmanpenilla/DynamicShop-Graph">GitHub</a>
- </li>
- <li><a class="grey-text text-lighten-3" href="https://www.spigotmc.org/resources/dynamicshop-graph.80638/">Spigot</a></li>
- </ul>
- </div>
- </div>
- </div>
- <div class="footer-copyright">
- <div class="container">
- Made using <a class="blue-text text-lighten-3" href="http://materializecss.com">Materialize</a>
- </div>
- </div>
- </footer>
- <!-- Scripts-->
- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
- <script src="https://code.highcharts.com/stock/highstock.js"></script>
- <script src="https://code.highcharts.com/stock/modules/data.js"></script>
- <script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
- <script src="https://code.highcharts.com/stock/modules/export-data.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
- <script language="JavaScript">
- const urlParams = new URLSearchParams(window.location.search);
- const dataFile = urlParams.get('data');
- $(document).ready(function () {
- $('select').formSelect();
- $.get('data/availableData.json', function (a) {
- for (var i = 0; i < a.length; i++) {
- var newValue = ["?data=" + a[i]];
- var $newOpt = $("<option>").attr("value", newValue).text(a[i]);
- $("#data-select").append($newOpt);
- }
- $('select').formSelect();
- });
- $('#data-select').bind('change', function () {
- var url = $(this).val();
- window.location = url;
- return false;
- });
- function createChart() {
- Highcharts.setOptions({
- colors: ['#dd2c00', '#00ff40', '#005eff'],
- lang: {
- months: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
- weekdays: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
- shortMonths: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
- },
- numericSymbolMagnitude: 10000
- });
- var gHeight = window.innerHeight - $('header').height() - $('footer').height() - 200;
- if (gHeight < 400) {
- gHeight = 400;
- }
- chartOptions = {
- chart: {
- renderTo: 'graphContainer',
- height: gHeight,
- },
- rangeSelector: {
- allButtonsEnabled: true,
- buttons: [{
- type: 'day',
- count: 1,
- text: '오늘',
- dataGrouping: {
- forced: false,
- units: [
- ['minute', [5]]
- ]
- }
- }, {
- type: 'week',
- count: 1,
- text: '이번주',
- dataGrouping: {
- forced: true,
- units: [
- ['hour', [1]]
- ]
- }
- }, {
- type: 'all',
- text: '전체',
- dataGrouping: {
- forced: true,
- units: [
- ['hour', [1]]
- ]
- }
- }],
- buttonTheme: {
- width: 60
- },
- selected: 1
- },
- title: {
- text: dataFile
- },
- data: {
- csvURL: window.location.origin + '/data/' + dataFile + '.csv',
- enablePolling: true,
- dataRefreshRate: 10
- },
- yAxis: [{
- opposite: false,
- labels: {
- enabled: false
- }
- }, {
- opposite: false,
- labels: {
- enabled: true,
- format: '{value}개'
- }
- }, {
- opposite: false,
- labels: {
- enabled: true,
- format: '{value}원'
- }
- }],
- legend: {
- enabled: true
- },
- xAxis: {
- ordinal: false,
- followPointer: false,
- type: "datetime",
- showLastLabel: true,
- tickWidth: 1,
- labels: {
- enabled: true
- }
- },
- plotOptions: {
- series: {
- showInNavigator: true,
- events: {
- legendItemClick: function () {
- let series = this.chart.series,
- i = series.length,
- otherSeries;
- while (i--) {
- otherSeries = series[i]
- if (otherSeries != this && otherSeries.visible) {
- otherSeries.hide();
- }
- }
- }
- }
- },
- },
- tooltip: {
- pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>',
- valueDecimals: 2,
- split: true
- },
- series: [{
- yAxis: 0,
- visible: false,
- showInLegend: false
- }, {
- yAxis: 1,
- visible: false
- }, {
- yAxis: 2
- }]
- }
- chart = new Highcharts.stockChart(chartOptions);
- }
- createChart();
- })
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement