Skip to content

Commit

Permalink
Merge pull request #75 from kusitms-28th-Meetup-E/design/#74/chartRes…
Browse files Browse the repository at this point in the history
…ponsive

design : chart responsive
  • Loading branch information
hoyyChoi authored Nov 22, 2023
2 parents e6d0704 + 908fa6a commit ed65eb4
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 10 deletions.
29 changes: 24 additions & 5 deletions src/components/molecules/packbubble/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import HighchartsAccessibility from "highcharts/modules/accessibility";
import HighchartsExporting from "highcharts/modules/exporting";
import HighchartsReact from "highcharts-react-official";
import { useNavigate } from "react-router-dom";
import styled from "styled-components";

import { packbubbleDummydata } from "@/dummy/packBubbleData";

Expand All @@ -30,7 +31,7 @@ const PackBubble = () => {
chart: {
type: "packedbubble",
width: width,
height: 524,
height: 524, //524
backgroundColor: "transparent",
zIndex: 9,
},
Expand Down Expand Up @@ -120,11 +121,29 @@ const PackBubble = () => {
series: packbubbleDummydata, // 데이터 값
};
return (
<HighchartsReact
highcharts={Highcharts}
options={options}
/>
<Container>
<HighchartsReact
highcharts={Highcharts}
options={options}
/>
</Container>
);
};

export default PackBubble;

export const Container = styled.div`
@media (max-width: 590px) {
.highcharts-legend-item {
display: none !important;
}
.highcharts-root {
padding-top: 30px;
}
}
@media (max-width: 400px) {
.highcharts-root {
padding-top: 80px;
}
}
`;
41 changes: 38 additions & 3 deletions src/components/organisms/Home/BubbleChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ const Container = styled.div`
`;

const BubbleCover = styled.div`
width: 1080px; // 여기 반응형 작업 잘하기
max-width: 1080px;
width: 94.12%; // 여기 반응형 작업 잘하기
height: 474px;
position: absolute;
top: 0;
left: 0;
right: 0;
margin: 0 auto;
`;

Expand All @@ -66,6 +65,28 @@ const Date = styled.div`
margin-top: 8px;
width: 60px;
}
@media (max-width: 850px) {
font-size: 1.2rem;
line-height: 28px;
img {
width: 50px;
}
}
@media (max-width: 590px) {
left: 0;
margin: 0 auto;
display: flex;
justify-content: center;
font-size: 1.3rem;
.firstLine,
.secondLine {
margin-right: 10px;
}
img {
width: 60px;
margin-top: 5px;
}
}
@media (max-width: 400px) {
top: 30px;
left: 0;
Expand All @@ -80,6 +101,7 @@ const Date = styled.div`
}
img {
width: 60px;
margin-top: 5px;
}
}
`;
Expand All @@ -99,6 +121,19 @@ const Title = styled.div`
position: absolute;
bottom: 0;
@media (max-width: 850px) {
font-size: 1.6rem;
line-height: 28px;
}
@media (max-width: 590px) {
left: 0;
right: 0;
bottom: -50px;
margin: 0 auto;
display: flex;
justify-content: center;
font-size: 1.3rem;
}
@media (max-width: 400px) {
left: 0;
Expand Down
4 changes: 2 additions & 2 deletions src/components/organisms/Home/MainTopic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const TopicWrapper = styled.div`
@media (max-width: 880px) {
display: flex;
flex-wrap: wrap;
width: 400px;
width: 560px;
justify-content: center;
margin: 0 auto;
& > div {
Expand All @@ -102,7 +102,7 @@ const TopicWrapper = styled.div`
@media (max-width: 564px) {
flex-wrap: wrap;
width: 200px;
width: 340px;
justify-content: center;
margin: 0 auto;
& > div {
Expand Down

0 comments on commit ed65eb4

Please sign in to comment.