Skip to content

Commit

Permalink
:iphon:main
Browse files Browse the repository at this point in the history
  • Loading branch information
noeypatt committed Apr 2, 2020
1 parent d49e620 commit e2d5605
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 28 deletions.
9 changes: 9 additions & 0 deletions components/chart/barChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ const Barchart = () => {
text: 'สถานภาพของผู้สูงอายุ',
align: 'left'
},
responsive: [{
breakpoint: 575.98,
options: {
legend: {
position: "bottom",
offsetY: 5
},
},
}],
chart: {
stacked: true,
toolbar: {
Expand Down
66 changes: 38 additions & 28 deletions components/chart/barMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,45 @@ import { useMediaQuery } from 'react-responsive';

const BarMap = props => {

const isMobile = useMediaQuery({ maxWidth: 1280 })
const isMobile = useMediaQuery({ maxWidth: 575.98 })

const isSmallScreen = useMediaQuery({ maxWidth: 768 })

const [options, setOptions] = useState({
title: {
text: 'สถานภาพของผู้สูงอายุ',
align: 'left'
},
chart: {
},
chart: {
stacked: true,
toolbar: {
show: true
show: true
},
zoom: {
enabled: true
enabled: true
}
},
plotOptions: {
},
plotOptions: {
bar: {
horizontal: false,
horizontal: false,
},
},
legend: {
},
legend: {
position: 'right',
offsetY: 40
},
fill: {
},
fill: {
opacity: 1,
colors: ['#00d084']
},
tooltip: {
},
tooltip: {
y: {
formatter: function (val) {
return val + " คน"
}
formatter: function (val) {
return val + " คน"
}
}
},
dataLabels: {
},
dataLabels: {
enabled: false
},
xaxis: {
Expand Down Expand Up @@ -101,22 +102,31 @@ const BarMap = props => {
return (
<React.Fragment>
{
isSmallScreen ?
isMobile ?
<Chart
options={options}
series={series}
type="bar"
height="300"
width="350"
width="300"
/>
:
<Chart
options={options}
series={series}
type="bar"
height="400"
width="650"
/>
isSmallScreen ?
<Chart
options={options}
series={series}
type="bar"
height="300"
width="350"
/>
:
<Chart
options={options}
series={series}
type="bar"
height="400"
width="650"
/>
}
</React.Fragment>
)
Expand Down

1 comment on commit e2d5605

@vercel
Copy link

@vercel vercel bot commented on e2d5605 Apr 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.