Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>MeetaMIS - Gráficos </title>
- <link rel="stylesheet" href="http://localhost:92/assets/css/materialize.inside.css">
- <link rel="stylesheet" href="http://localhost:92/assets/css/custom.css">
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
- <style>
- .related-tabs.row {
- background: #FFFFFF;
- margin-top: 10px;
- }
- .related-tabs {
- position: relative;
- }
- .row {
- margin-right: -15px;
- margin-left: -15px;
- }
- * {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .related-tabs ul {
- padding-left: 10px;
- width: 100%;
- }
- .nav {
- padding-left: 0;
- margin-bottom: 0;
- list-style: none;
- }
- ul, ol {
- margin-top: 0;
- margin-bottom: 10px;
- }
- .nav-tabs > a > li {
- padding: 0 10px;
- margin: 0 2px;
- float: left;
- margin-bottom: -1px;
- color: #666;
- border-radius: 2px 2px 0 0;
- margin-right: 2px;
- line-height: 1.42857143;
- border: 1px solid transparent;
- border-radius: 4px 4px 0 0;
- }
- .related-tabs .nav-tabs> a > li.active, .related-tabs .nav-tabs> a > li:hover{
- border-bottom: 2px solid #e99b6c;
- }
- .nav-tabs> a > li.active, .nav-tabs> a:hover > li.active, .nav-tabs> a:focus > li.active {
- font-weight: 700;
- color: #333;
- }
- .nav-tabs > a > li.active{
- color: #555;
- cursor: default;
- border: 1px solid #ddd;
- border-bottom-color: transparent;
- }
- .nav-tabs> a > li:last-child {
- margin-right:13px !important;
- }
- .nav> a > li {
- position: relative;
- display: block;
- padding: 10px 15px;
- }
- .textOverflowEllipsis {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .related-tabs .tab-label {
- display: inline-block;
- height: 26px;
- line-height: 5px;
- padding: 15px;
- text-transform: uppercase;
- color: #8b8f9c;
- }
- /* fim menu */
- .fundoW{
- }
- .margin5{
- margin:5px;
- }
- .right{
- float:right !important
- }
- [class^="tabss-"] {
- display:none;
- }
- .tabs-container > .active {
- display: block;
- }
- html,body,#myChart {
- width:100%;
- height:100%;
- }
- .zc-ref {
- display: none;
- }
- </style>
- </head>
- <body>
- <ul id="slide-out" class="side-nav sidenav-fixed z-depth-2">
- <li class="center no-padding">
- <div class="colorSite white-text" style="height: 180px;">
- <div class="row">
- <a href="http://localhost:92/dashboard">
- <img style="margin-top: 5%;" width="130" height="130" src="http://localhost:92/assets/imgs/logo.png" class="responsive-img" />
- </a>
- </div>
- </div>
- </li>
- <!--
- <li id="dash_adm"><a class="waves-effect" href="http://localhost:92/dashboard"><b>Menu admin</b></a></li>
- -->
- <li id="dash_dashboard"><a class="waves-effect" href="http://localhost:92/dashboard"><b>Dashboard</b></a></li>
- <li id="dash_graficos"><a class="waves-effect" href="http://localhost:92/modules/graphics"><b>Gráficos</b></a></li>
- <ul class="collapsible" data-collapsible="accordion">
- <li id="dash_users">
- <div id="dash_users_header" class="collapsible-header waves-effect"><b>Usuários</b></div>
- <div id="dash_users_body" class="collapsible-body">
- <ul>
- <li id="users_config">
- <a class="waves-effect" style="text-decoration: none;" href="http://localhost:92/conta/config">Configurações</a>
- </li>
- <li id="user_push">
- <a class="waves-effect" style="text-decoration: none;" href="http://localhost:92/conta/push">Push</a>
- </li>
- </ul>
- </div>
- </li>
- </ul>
- </ul>
- <header>
- <nav class="colorSite" role="navigation">
- <a href="#" data-target="slide-out" class="sidenav-trigger sidenav-triggerjquery show-on-large left"><i class="material-icons">menu</i></a>
- <div class="nav-wrapper">
- <a data-activates="slide-out" class="button-collapse" href="#!"><img width="200px" height="50px" style="object-fit: cover;object-position: 0px -130px;" src="http://localhost:92/assets/imgs/logo.png" /></a>
- <ul class="right hide-on-med-and-down">
- <li>
- <a class='right dropdown-button' href='#!' data-target='user_dropdown'><i class=' material-icons'>account_circle</i></a>
- <ul class="dropdown-content" id="user_dropdown">
- <li><a class="indigo-text" href="http://localhost:92/conta/config">Perfil</a></li>
- <li><a class="indigo-text" href="http://localhost:92/sair">Sair</a></li>
- </ul>
- </li>
- </ul>
- <a href="#" data-activates="slide-out" class="button-collapse"><i class="mdi-navigation-menu"></i></a>
- </div>
- </nav>
- <nav>
- <div class="nav-wrapper colorSiteUp">
- <a style="margin-left: 20px;" class="breadcrumb" href="http://localhost:92/dashboard">Dashboard</a>
- <a class="breadcrumb" href="#!"> Gráficos </a>
- <div style="margin-right: 20px;" id="timestamp" class="right"></div>
- </div>
- </nav>
- </header>
- <main>
- <div class="row nomargin">
- <div class="col s12">
- <div class="card paddingCard">
- <div class="related-tabs row">
- <ul class="nav nav-tabs">
- <a href="#graphich1" class="tab-item" data-tab-id="graphich1"><li class="graphich1 active"><span class="tab-label">Faturamento</span></li></a>
- <a href="#graphich2" class="tab-item" data-tab-id="graphich2"><li class="graphich2"><span class="tab-label">Hardware</span></li></a>
- </ul>
- </div>
- <div class="tabs-container">
- <div class="tabss-graphich1 active">
- <div class="row">
- <div class="col s12 m6 l3">
- <div class="card animate fadeLeft">
- <div class="card-content cyan white-text">
- <p class="card-stats-title"><i class="material-icons">person_outline</i> Servidores azure</p>
- <h4 class="card-stats-number white-text">16</h4>
- <p class="card-stats-compare">
- <!-- <i class="material-icons">keyboard_arrow_up</i> 15%
- <span class="cyan text text-lighten-5">de ontem</span>-->
- </p>
- </div>
- </div>
- </div>
- <div class="col s12 m6 l3">
- <div class="card animate fadeLeft">
- <div class="card-content red accent-2 white-text">
- <p class="card-stats-title"><i class="material-icons">attach_money</i>Custo de Junho</p>
- <h4 class="card-stats-number white-text">R$ 723.875,00</h4>
- <!-- <p class="card-stats-compare">
- <i class="material-icons">keyboard_arrow_up</i> 70% <span class="red-text text-lighten-5">último mês</span>
- </p>-->
- </div>
- </div>
- </div>
- <div class="col s12 m6 l3">
- <div class="card animate fadeRight">
- <div class="card-content orange lighten-1 white-text">
- <p class="card-stats-title"><i class="material-icons">trending_up</i> Servidores desatualizados</p>
- <h4 class="card-stats-number white-text">9</h4>
- <!--<p class="card-stats-compare">
- <i class="material-icons">keyboard_arrow_up</i> 80%
- <span class="orange-text text-lighten-5">de hoje</span>
- </p>-->
- </div>
- </div>
- </div>
- <div class="col s12 m6 l3">
- <div class="card animate fadeRight">
- <div class="card-content green lighten-1 white-text">
- <p class="card-stats-title"><i class="material-icons">content_copy</i> Fazer inventário</p>
- <h4 class="card-stats-number white-text">2</h4>
- <!--<p class="card-stats-compare">
- <i class="material-icons">keyboard_arrow_down</i> 3%
- <span class="green-text text-lighten-5">total do mês</span>
- </p>-->
- </div>
- </div>
- </div>
- <div class="col s12">
- <div id='graphics4chart'></div>
- </div>
- </div>
- </div>
- <div class="tabss-graphich2">
- </div>
- </div>
- </div>
- </div>
- </main>
- <footer class="colorSite page-footer">
- <div class="container">
- <div class="row">
- <div class="col s12">
- <h5 class="white-text">MeetaMIS - Relatórios</h5>
- </div>
- </div>
- </div>
- <div class="footer-copyright">
- <div class="container">
- <span></span>
- </div>
- </div>
- </footer>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
- <script src="http://localhost:92/assets/js/materialize.min.js"></script>
- <script src="http://localhost:92/assets/js/sweetalert2.min.js"></script>
- <script src="http://localhost:92/assets/js/script.js"></script>
- <script src="https://cdn.zingchart.com/zingchart.min.js"></script>
- <script>
- zingchart.THEME="classic";
- var myConfig = {
- "graphset":[
- {
- "type":"mixed",
- "x":0,
- "y":0,
- "height":"60%",
- "background-color":"#a6c675",
- "plotarea":{
- "margin":"20px 75px 0px 50px"
- },
- "tooltip":{
- "shadow":0
- },
- "labels":[
- {
- "text":"Custo anual",
- "x":"625px",
- "y":"14px",
- "font-color":"#fff",
- "font-size":"22px"
- },
- {
- "text":"Dos servidores azure da MeetaWEB",
- "x":"625px",
- "y":"40px",
- "font-color":"#D0E0B8",
- "font-size":"14px",
- "font-family":"arial narrow"
- }
- ],
- "scale-x": {
- "values":"0:100:9",
- "max-items": 12,
- "line-width":0,
- "tick":{
- "visible":true
- },
- "guide":{
- "visible":false
- },
- "item":{
- "visible":true
- },
- "labels": ["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]
- },
- "scale-x-2":{
- "values":"1:100:10",
- "line-width":0,
- "guide":{
- "visible":false
- },
- "item":{
- "visible":false
- },
- "tick":{
- "visible":false
- }
- },
- "scale-y":{
- "values":"0:25:10",
- "line-width":0,
- "item":{
- "visible":true
- },
- "tick":{
- "visible":false
- },
- "guide":{
- "visible":false
- },
- "label": {
- "text": "Servidores criados",
- }
- },
- "scale-y-2":{
- "line-width":0,
- "markers":[
- {
- "type":"line",
- "range":[757210],
- //"range":[25],
- "valueRange": true,
- "alpha":0.6,
- "line-color":"#777",
- "line-width":"1px",
- "line-style":"dashed"
- }
- ],
- "guide":{
- "visible":false
- },
- "item":{
- "visible":true
- },
- "tick":{
- "visible":false
- },
- "label": {
- "text": "Valor gasto",
- }
- },
- "series":[
- {
- "type":"bar",
- "background-color":"#9DBA73",
- "values":[ 6,
- 7,
- 4,
- 8,
- 7,
- 11,
- 8,
- 3,
- 7,
- 5,
- 8,
- 6,
- ],
- "scales":"scale-x, scale-y",
- "animation":{
- "effect":"ANIMATION_EXPAND_BOTTOM"
- },
- "border-radius-top-left":"3px",
- "border-radius-top-right":"3px",
- "bar-width":"30px",
- "hover-state":{
- "visible":0
- }
- },
- {
- "type":"line",
- "line-color":"#F5F8ED",
- "values":[663054,782768,851411,744238,542405,723875,711115,956929,1024657,585866,765841,734355],
- //"values":[1,2,3,4,555000,6,7,8,9,10,11,121],
- "scales":"scale-x-2, scale-y-2",
- "animation":{
- "effect":"ANIMATION_SLIDE_LEFT"
- },
- "marker":{
- "visible":false
- }
- }
- ]
- },
- {
- "type":"bar",
- "border-width":"2px",
- "border-color":"#f2f2f2",
- "x":0,
- "y":"60%",
- "height":"40%",
- "background-color":"#fff",
- "plot":{
- "bars-overlap":"100%",
- "bar-space":"5px",
- "bar-width":"20px",
- "animation":{
- "effect":"ANIMATION_SLIDE_BOTTOM"
- }
- },
- "plotarea":{
- "margin":"25px 25px 50px 60%"
- },
- "labels":[
- {
- "text":"+ R$ 757.209,50",
- "x":"20px",
- "y":"60px",
- "font-color":"#A7C47B",
- "font-size":"38px"
- },
- {
- "text":"média mensal",
- "x":"65px",
- "y":"110px",
- "font-color":"#ACACAC",
- "font-size":"16px"
- }
- ]
- }
- ]
- };
- zingchart.render({
- id : 'graphics4chart',
- data : myConfig,
- height: 500
- });
- zingchart.THEME="classic";
- var initState = null; // Used later to store the chart state before changing the data
- var store = { // Data store
- ie:[["v11.0",24.1],["v8.0",17.2],["v9.0",8.1],["v10.0",5.3],["v6.0",1.1],["v7.0",0.5]],
- chrome:[["v40.0",4.8],["v41.0",4.3],["v42.0",3.7],["v39.0",3.0],["v36.0",2.5],["v43.0",1.4],["v31.0",1.2],["v35.0",0.8],["v38.0",0.6],["v32.0",0.6],["v37.0",0.4],["v33.0",0.2],["v34.0",0.1],["v30.0",0.1]],
- firefox:[["v35",2.8],["v36",2.3],["v37",2.3],["v34",1.3],["v38",1.0],["v31",0.3],["v33",0.2],["v32",0.1]],
- safari:[["v8.0",2.6],["v7.1",0.8],["v5.1",0.4],["v5.0",0.3],["v6.1",0.3],["v7.0",0.3],["v6.2",0.2]],
- opera:[["v12.x",0.25],["v28",0.2],["v27",0.15],["v29",0.1]]
- };
- var bgColors = ["#1976d2","#424242","#388e3c","#ffa000","#7b1fa2","#c2185b"]; // ie, chrome, ff, safari, opera, unknown
- var myConfig = {
- "globals": {
- "font-family": "Helvetica"
- },
- "type": "bar",
- "background-color": "white",
- "title": {
- "color": "#606060",
- "background-color": "white",
- "text": "Browser market shares. January, 2015 to May, 2015"
- },
- "subtitle": {
- "color": "#606060",
- "text": "Click the columns to view versions. Source: netmarketshare.com."
- },
- "scale-y": {
- "line-color": "none",
- "tick": {
- "line-color": "none"
- },
- "guide": {
- "line-style": "solid"
- },
- "item": {
- "color": "#606060"
- }
- },
- "scale-x": {
- "values": [
- "Internet Explorer",
- "Chrome",
- "Firefox",
- "Safari",
- "Opera",
- "Unknown"
- ],
- "line-color": "#C0D0E0",
- "line-width": 1,
- "tick": {
- "line-width": 1,
- "line-color": "#C0D0E0"
- },
- "guide": {
- "visible": false
- },
- "item": {
- "color": "#606060"
- }
- },
- "crosshair-x": {
- "marker": {
- "visible": false
- },
- "line-color": "none",
- "line-width": "0px",
- "scale-label": {
- "visible": false
- },
- "plot-label": {
- "text": "%data-browser: %v% of total",
- "multiple": true,
- "font-size": "12px",
- "color": "#606060",
- "background-color": "white",
- "border-width": 3,
- "alpha": 0.9,
- "callout": true,
- "callout-position": "bottom",
- "shadow": 0,
- "placement": "node-top",
- "border-radius": 4,
- "offsetY":-20,
- "padding":8,
- "rules": [
- {
- "rule": "%i==0",
- "border-color": "#1976d2"
- },
- {
- "rule": "%i==1",
- "border-color": "#424242"
- },
- {
- "rule": "%i==2",
- "border-color": "#388e3c"
- },
- {
- "rule": "%i==3",
- "border-color": "#ffa000"
- },
- {
- "rule": "%i==4",
- "border-color": "#7b1fa2"
- },
- {
- "rule": "%i==5",
- "border-color": "#c2185b"
- }
- ]
- }
- },
- "plot": {
- "data-browser": [
- "<span style='font-weight:bold;color:#1976d2;'>Internet Explorer</span>",
- "<span style='font-weight:bold;color:#424242;'>Chrome</span>",
- "<span style='font-weight:bold;color:#388e3c;'>Firefox</span>",
- "<span style='font-weight:bold;color:#ffa000;'>Safari</span>",
- "<span style='font-weight:bold;color:#7b1fa2;'>Opera</span>",
- "<span style='font-weight:bold;color:#c2185b;'>Unknown</span>"
- ],
- "cursor": "hand",
- "value-box": {
- "text": "%v%",
- "text-decoration": "underline",
- "color": "#606060"
- },
- "tooltip": {
- "visible": false
- },
- "animation": {
- "effect": "7"
- },
- "rules": [
- {
- "rule": "%i==0",
- "background-color": "#1976d2"
- },
- {
- "rule": "%i==1",
- "background-color": "#424242"
- },
- {
- "rule": "%i==2",
- "background-color": "#388e3c"
- },
- {
- "rule": "%i==3",
- "background-color": "#ffa000"
- },
- {
- "rule": "%i==4",
- "background-color": "#7b1fa2"
- },
- {
- "rule": "%i==5",
- "background-color": "#c2185b"
- }
- ]
- },
- "series": [
- {
- "values": [
- 56.33,
- 24,
- 10.4,
- 4.8,
- 0.9,
- 0.2
- ]
- }
- ]
- };
- var updateChart = function(p){
- initState = zingchart.exec(p.id,'getdata'); // Gets the state of the chart when the node was clicked
- var newValues = null;
- var update = null;
- switch(p.nodeindex){
- case 0:
- newValues = store['ie'];
- update = true;
- break;
- case 1:
- newValues = store['chrome'];
- update = true;
- break;
- case 2:
- newValues = store['firefox'];
- update = true;
- break;
- case 3:
- newValues = store['safari'];
- update = true;
- break;
- case 4:
- newValues = store['opera'];
- update = true;
- break;
- case 5:
- update = false; // We don't want to allow drilldown for unknown
- break;
- }
- if(update){
- zingchart.unbind(p.id, 'node_click'); // Disable node_click for second level
- zingchart.exec(p.id, 'modify', {
- update:false, // Making multiple changes, queue these changes
- data:{
- "crosshair-x":{
- "plot-label":{
- "text":"%v% of total",
- "rules":[],
- "border-color": bgColors[p.nodeindex]
- }
- },
- "plot":{
- "cursor":null,
- "rules":[],
- "background-color": bgColors[p.nodeindex]
- },
- "scale-x":{
- "values":[]
- }
- }
- });
- zingchart.exec(p.id, 'setseriesvalues',{ // Replaces all values at plotindex 0
- update:false, // Queue these, too
- plotindex:0,
- values:newValues
- });
- zingchart.exec(p.id,'update'); // Push queued changes
- zingchart.bind(p.id, 'animation_end', function(){ // When the animation ends...
- zingchart.exec(p.id, 'addobject',{ // ...add a back button
- type:'shape',
- data:{
- "type":"rectangle",
- "id":"back_btn",
- "height":20,
- "width":70,
- "background-color":"#ffffff #f6f6f6",
- "x":"80%",
- "y":"16%",
- "border-width":1,
- "border-color":"#888",
- "cursor":"hand",
- "label":{
- "text":"< Back",
- "color": "#606060"
- },
- "hover-state":{
- "background-color":"#1976D2 #ffffff",
- "border-color":"#57a2ff",
- "fill-angle": -180
- }
- }
- });
- });
- }
- };
- zingchart.render({
- id : 'myChart',
- data : myConfig,
- });
- zingchart.bind('myChart','node_click',updateChart);
- zingchart.bind('myChart', 'shape_click', function(p){ // Listen for back button click
- zingchart.unbind(p.id,'animation_end');
- if (p.shapeid == "back_btn"){
- zingchart.exec(p.id,'setdata',{ // Set the data back to the state it was in when the node was clicked
- data:initState
- });
- zingchart.bind(p.id,'node_click',updateChart);
- }
- });
- let tabsAssoc =["graphich1", "graphich2", "graphich3", "graphich4", "graphich5"];
- $(document).ready(function() {
- verificaHash();
- function navegarAteTab(tabid)
- {
- let ativa = $('.active');
- ativa.removeClass('active');
- $("."+tabid).addClass('active');
- $(".tabss-" + tabid).addClass('active');
- }
- function verificaHash()
- {
- let hash = window.location.hash;
- if (hash !== '')
- {
- hash = hash.replace("#", "");
- if (tabsAssoc.indexOf(hash) > -1) {
- navegarAteTab(hash);
- }else if(hash.indexOf(".") > -1){
- let id = hash.split(".");
- $("."+id[1]).prop("checked", true);
- navegarAteTab(id[0]);
- }
- }
- }
- $(".tab-item").click(function() {
- let tab_id = $(this).data('tab-id');
- navegarAteTab(tab_id);
- });
- });
- </script>
- <script>
- $('.side-nav').sidenav({closeOnClick: true});
- $('.dropdown-button, .dropdown-trigger').dropdown();
- $('.collapsible').collapsible();
- $('select').formSelect();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement