made graph responsive
This commit is contained in:
parent
b157e903ba
commit
9587d4b5c2
3 changed files with 9 additions and 7 deletions
|
@ -2,11 +2,6 @@
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.js-plotly-plot .plotly .user-select-none {
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ntpBanner{
|
||||
margin-top: 10px;
|
||||
display: block;
|
||||
|
|
|
@ -60,5 +60,9 @@ function drawPlot(elementName:string, x:Date[], y:number[], title:string){
|
|||
let layout = {
|
||||
title: title,
|
||||
};
|
||||
Plotly.newPlot(elementName, [score], layout);
|
||||
let config = {
|
||||
responsive: true
|
||||
};
|
||||
|
||||
Plotly.newPlot(elementName, [score], layout, config);
|
||||
}
|
|
@ -2,13 +2,16 @@ let ntpNav = document.querySelectorAll(".ntpBanner");
|
|||
|
||||
ntpNav.forEach((element) => {
|
||||
(<HTMLElement>element).onclick = function (){
|
||||
let contentID = element.getAttribute("data-index") + "-Content";
|
||||
let index = element.getAttribute("data-index");
|
||||
let contentID = index + "-Content";
|
||||
let contentElement = <HTMLElement> document.getElementById(contentID);
|
||||
|
||||
if(contentElement.classList.contains("visible")){
|
||||
contentElement.classList.remove("visible");
|
||||
} else {
|
||||
contentElement.classList.add("visible");
|
||||
Plotly.relayout(index + "-Delay", {autosize: true});
|
||||
Plotly.relayout(index + "-Score", {autosize: true});
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Reference in a new issue