Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

257
Views
React js split screen resize

I would like to get an effect similar to what you see in the image.

But I'm having doubts about how it should resize screens.

Can anyone give me a hand?

Re

Link: codesanbox

Code:

import "./styles.css";
import SplitPane from "react-split-pane";
import { Line } from "react-chartjs-2";

export default function App() {
  const chart = () => {
    return (
      <Line
        data={{
          labels: [
            "Boston",
            "Worcester",
            "Springfield",
            "Lowell",
            "Cambridge",
            "New Bedford"
          ],
          datasets: [
            {
              data: [617594, 181045, 153060, 106519, 105162, 95072],
              backgroundColor: [
                "rgba(255, 99, 132, 0.6)",
                "rgba(54, 162, 235, 0.6)",
                "rgba(255, 206, 86, 0.6)",
                "rgba(75, 192, 192, 0.6)",
                "rgba(153, 102, 255, 0.6)",
                "rgba(255, 159, 64, 0.6)",
                "rgba(255, 99, 132, 0.6)"
              ]
            }
          ]
        }}
        options={{
          title: {
            display: true,
            text: "Largest Cities in Massachusetts",
            fontSize: 25
          },
          legend: {
            display: false,
            position: "bottom",
            labels: {
              fontColor: "#000"
            }
          }
        }}
      />
    );
  };

  return (
    <div className="App">
      <SplitPane split="horizontal" defaultSize={"50%"}>
        <SplitPane split="vertical" defaultSize={"50%"}>
          <div>TopSx{chart()}</div>
          <div>TopDx{chart()}</div>
        </SplitPane>
        <SplitPane split="vertical" defaultSize={"50%"}>
          <div>BottomSx{chart()}</div>
          <div>BottomDx{chart()}</div>
        </SplitPane>
      </SplitPane>
    </div>
  );
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!