DyGraph를 올바른 높이로 렌더링 할 수 없습니다. 나의 이상은 그래프가 메인 브라우저 영역 높이의 100 %가되는 것이다.Dygraph를 div에서 높이를 채우려면 어떻게 만듭니 까?
즉, navbar와 footer 사이의 모든 공간을 채우고 싶습니다.
아래의 설정을 통해 그래프를 얻을 수 있지만 단지 하나의 수평선에 불과합니다. 사용할 수있는 공간을 채우려면 px 높이를 지정하고 싶지 않습니다.
_PnlDyGraph.cshtml :
<script type="text/javascript" src="dygraph-combined-dev.js"></script>
<h1>Title</h1>
<div id="mygrapharea" style="width: 100%; height:100%;"></div>
<script type="text/javascript">
@{
string txtER = (string)Session["PnlDataForChart"];
<text>
var dataT = "@txtER"
</text>
}
g = new Dygraph(document.getElementById("mygrapharea"),
dataT
);
</script>
_Traders.cshtml :
<div class="row">
<div class="col-sm-6">
@Html.Partial("~/Views/Employee/_PnlDyGraph.cshtml")
</div>
</div>
_Layoutcshtml : 당신은 픽셀이 다른 사업부의 사업부 지정된 DIV의 높이를 작성해야
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@*<title>@ViewBag.Title - Platform</title>*@
<title>Platform</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="~/Images/Banner_Front.png" alt="Banner" style="width:300px;height:50px;"/>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("Traders", "Traders", "Traders")</li>
<li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>
@Html.Partial("_LoginPartial")
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
@*<p>© @DateTime.Now.Year</p>*@
</footer>
</div>
@*@Scripts.Render("~/bundles/jquery")*@
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>
div의 높이를 기준으로 페이지 크기를 조정하면 DyGraph의 크기가 자동으로 조정되지 않으므로 DyGraph의 resize() 메소드를 사용해야합니다. 같은 gygraph 집합 변수는 g1 다음 g1.resize(); 내 응용 프로그램에서 작동합니다. –
'g = new Dygraph (document.getElementById ("mygrapharea"), dataT ) 이후에 포함되었습니다. g.resize();' – ManInMoon
이고 문제는 여전히 동일합니다 – ManInMoon