html - Put a Cytoscape graph inside a Bootstrap column -
i have 4 bootstrap columns: col-lg-1, col-lg-1, col-lg-4 , col-lg-6 (from left right).
in biggest column (col-lg-6), have cytoscape graph. cytoscape style following (in <head>
section):
<style type="text/css"> #cy { height: 80%; width: 50%; position: absolute; left: 40%; top: 20%; background:red; } </style>
then in body section, have leftmost column:
<div id="cy" class="col-lg-6" style="background-color:grey;"> text </div>
finally, have script in body section of html document:
<script type="text/javascript"> $( document ).ready(function() { var cy = cytoscape({ container: document.getelementbyid('cy'), ..... }); }); </script>
the problem cytoscape graph (and leftmost column) doesn't stack below other columns when browser resizes (as expected in bootstrap behavior).
can please show me somehow detailed solution this, appreciate expertise much.
first of include the cytoscape graph section inside col-lg-6
get rid of position: absolute
set height: 100%
check working demo here
sample structure:
<!-- container-fluid : start --> <div class="container-fluid"> <row> <div class="col-sm-6"> <----include other stuff here-----> </div> <div class="col-sm-6"> <!-- graph : start --> <div class="panel panel-primary"> <div class="panel-heading">graph</div> <div class="panel-body"> <div id="cy-container"> <div id="cy"></div> </div> </div> </div> <!-- graph : end --> </div> </row> </div>
Comments
Post a Comment