Displaying various charts in a single view without the need for scrolling in HTML

How can I display the first chart larger and all subsequent charts together in one window without requiring scrolling? This will eventually be viewed on a larger screen where everything will fit perfectly. Any recommendations on how to achieve this?

Here is my current page layout for reference: Current(Needs scrolling to view everything)

And here is the desired layout that I need: Requirement(No scrolling is needed)

I am using AngularJS in conjunction with HTML.

I am new to HTML, CSS, Angular, and JS so any assistance would be greatly appreciated!

Answer №1

Instead of utilizing the suggested boxes layout, consider implementing tabs for a better user experience.

HTML

<div class="pane">
    <h3>Plotly charts</h3>
    <ul class="tabrow">
        <li ng-repeat="tab in tabs"
            ng-class="{active:isActiveTab(tab.url)}"
            ng-click="onClickTab(tab)">{{tab.title}}</li>
    </ul>
    <div id="mainView">
        <div ng-include="currentTab"></div>
    </div>
</div>
<script type="text/ng-template" id="one.tpl.html">
    <div id="viewOne" class="tabcontent">
        <div id="plotlyChart"></div>
    </div>
</script>

... (additional script templates) ...

etc

CSS

/* customized CSS for tabs styling */ 
.tabrow {
  text-align: center;
  list-style: none;
  margin: 0;
  padding: 0;
  line-height: 24px;
}

... (other CSS styles) ...

AngularJS

.controller('perspectivesCtrl',
['$rootScope', '$scope', '$uibModal', '$routeParams', '$log', '$timeout', '$http', 'getMessages',
    function ($rootScope, $scope, $uibModal, $routeParams, $log, $timeout, $http, getMessages) {

        $scope.tabs = [{
            title: 'One',
            url: 'one.tpl.html'
        }, {
            title: 'Two',
            url: 'two.tpl.html'
        }, {
            title: 'Three',
            url: 'three.tpl.html'
        }];

        $scope.currentTab = 'one.tpl.html';

        $scope.onClickTab = function (tab) {
            $scope.currentTab = tab.url;
        }

        $scope.isActiveTab = function (tabUrl) {
            return tabUrl == $scope.currentTab;
        }
    }])

Answer №2

To display it using boxes in a responsive manner, consider implementing the following structure:

HTML

<div class="pane">
    <h3>Plotly charts</h3>
    <div class="page-wrap">
        <div class="two-col">
            <div class="chart-box">
                <div id="plotlyChart"></div>
            </div>
            <div class="chart-box">
                <div id="plotlyChart_1"></div>
            </div>
        </div>
    </div>
    <div class="two-col">
        <div id="plotlyChart"></div>
    </div>
</div>

CSS Make sure to customize the column widths and adjust the number of column classes based on your page's design.

/* responsive grid */

.page-wrap {
    flex-wrap: wrap;
}

.box,
.chart-box
{
    display: inline-block;
    padding: 0;
    vertical-align: top;
}

.box h3 {
    padding: 3px;
}

.one-col {
    width: 48%;
    display: inline-table;
}

.two-col {
    width: 97%;
    margin: 0 auto;
}

.inner-box {
    padding: 6px;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with MaterializeCSS: Unable to add new options to select menu

I have a function that appends options to a dropdown based on the onchange event. The options are being appended successfully, but they are not visible when clicking the dropdown. $(document).ready(function(){ $('select').formSelect(); }) ...

Using the && operator in an if statement along with checking the length property

Why does the console show 'Cannot read property 'length' of undefined' error message when I merge two if conditions together? //When combining two if statements using &&: for(n= 0, len=i.length; n<len; n++) { if(typeof ...

Emphasize the active item in the PHP header

Hey there! I've been trying to figure out how to highlight the current page in the header of my website. I'm using the include method to call the header on all pages, but I can't seem to figure out how to highlight the current page while sti ...

Can anyone suggest a way to change the orientation of mapped items from column to row?

In my React app, I am creating a keyboard using the following component: Keypad.js const Keypad = () => { const letters = [ 'Q', 'W', 'E', 'R', 'T', ...

Are there alternative methods for retrieving data in Vue Hacker News besides using prefetching?

I am currently developing a Vue single page application with server side rendering using Vue SSR. As per the official documentation, data in components will be prefetched server-side and stored in a Vuex store. This process seems quite intricate. Hence, ...

Struggling to send data to child components in Vue: Received an object instead of the expected string value of "[object Object]"

My goal is to create a basic To-Do app where, upon clicking the button <b-button v-on:click="newItem" pill variant="primary">Add</b-button>, the input text is displayed below. To achieve this, I am using v-model in the input field (located in ...

Issues with functionality of Bootstrap 5 popover in responsive JavaScript DataTable

As I work on constructing a web page for my hobby, I am utilizing Bootstrap 5.3.3 and JS DataTables 2.0.5. Within the page, there is a table displaying data about various players. I have implemented a feature where clicking on certain cells triggers a popo ...

The webpage lacked the functionality of smooth scrolling

I created a website which you can view here. Check out the code below: <div id="mainDiv" class="container"> <div id="header"> <div class="plc"> <h1><a href="#"></a></h1> ...

Managing data in React and JavaScript: Clearing fields upon successful sign up and redirecting to login page after receiving a 200 status code

Here is the code for my SignUp react function. After receiving a response of 200 upon clicking the Sign up button, I want to clear the text in all three fields and redirect the user back to the login page. I'm new to web development so any assistance ...

The IDE is showing an error, but Jest is able to run it flawlessly

I recently created a Jest unit test for a TypeScript function called checkEmail, which internally uses showAlert. The showAlert function in the utils.ts file looks like this: export const showAlert = (message: string) => { toast(message); }; In my ...

The extent of the modal window (AngularJS directive)

I've been experimenting with a modal window feature using Angular UI Bootstrap. Within the parent controller, I've defined the following function: $scope.open = function () { var modalInstance = $modal.open({ templateUr ...

Is there a way to wrap the "#+ATTR_HTML" tags around the preview output of the "#+RESULTS" Source Block in Org-mode for Emacs?

Using plantuml in org works fine for me. However, I am looking to enhance it by automatically inserting some HTML tags just before the #+RESULTS output tag. This will help achieve a more visually appealing HTML output effect. Here's an example of my ...

Retrieve records with at least one connection, but display all of them

After creating this entry, it now consists of 2 tags - tag1 and tag2. { "id": "d87de1d9-b048-4867-92fb-a84dca59c87e", "name": "Test Name", "tags": [ { "id": "fa0ca8fd-eff4-4e58-8bb0-a1ef726f01d4", "name": "tag1", "organizationI ...

The Challenge of Referencing Javascript Files (including jQuery)

Previously, I had the following code snippet: <head> <script src="/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script> <script type="text/javascript"> var optPrompt = "- Select One -"; var subCats ...

Retrieve weight measurements from a serial port by using Node JS

I'm a novice in node.js and I'm trying to retrieve weight data from a serial port. I have nodejs(v14.19.0) and npm(6.14.16) installed, and I'm attempting to obtain weight data using localhost:8080/get_weight. However, the script isn't f ...

What steps can I take to prevent a css-generated svg file from occupying more space than the original image? My wave appears to be 239px tall, while the svg file is a massive 1500px in height

I utilized an online tool to generate custom SVG CSS at this link: Upon implementing it on my webpage, the rendering seems correct in terms of height and width. However, upon inspecting the page, I noticed that the SVG file dimensions are 1512px by 1512px ...

What is the best way to locate an item reference for a specific DOM element?

Imagine a vast DOM structure with approximately 10,000 HTML elements, including 1,000 span tags. None of the span elements have any identifiers and are buried deep within other objects with long, complex Xpath paths that are not user-friendly for selectio ...

Implementing three identical dropdown menus using jQuery and HTML on a single webpage

It seems like I've tangled myself up in a web of confusion. I'm trying to have three identical dropdowns on a single page, each displaying clocks from different cities (so users can view multiple clocks simultaneously). However, whenever I update ...

"Utilizing margins to create space between elements within a Bootstrap

I am currently utilizing bootstrap 4 and have a list of items that I am displaying in the following manner: <div class="container"> <div class="row"> <div class="card col-md-4 col-sm-6 col-12 item-wr" *ngFor="let item of items"> ...

The Express server is set up with CORS enabled, however, it continues to encounter issues when attempting to make asynchronous HTTP requests from

We're currently experiencing an unusual issue and are seeking assistance to resolve it. Initially, our Express server is functioning well as an API when accessed from the same domain. However, we also need to utilize this API on our computers for tes ...