Skip to content

Commit 9863e69

Browse files
committed
fix chart options
1 parent 607bc8b commit 9863e69

File tree

1 file changed

+10
-48
lines changed

1 file changed

+10
-48
lines changed

frontend/routes/package/(_islands)/DownloadChart.tsx

+10-48
Original file line numberDiff line numberDiff line change
@@ -86,59 +86,21 @@ export function DownloadChart(props: Props) {
8686
borderColor: isDarkMode ? "#47515c" : "#e5e8eb", // jsr-gray-700 for dark mode, jsr-gray-100 for light
8787
strokeDashArray: 3,
8888
},
89+
responsive: [
90+
{
91+
breakpoint: 768,
92+
options: {
93+
legend: {
94+
horizontalAlign: "left",
95+
},
96+
},
97+
},
98+
],
8999
});
90100

91101
useEffect(() => {
92102
(async () => {
93103
const { default: ApexCharts } = await import("apexcharts");
94-
chartRef.current = new ApexCharts(chartDivRef.current!, {
95-
chart: {
96-
type: "area",
97-
stacked: true,
98-
animations: {
99-
enabled: false,
100-
},
101-
height: "100%",
102-
width: "100%",
103-
zoom: {
104-
allowMouseWheelZoom: false,
105-
},
106-
},
107-
legend: {
108-
horizontalAlign: "center",
109-
position: "top",
110-
showForSingleSeries: true,
111-
},
112-
tooltip: {
113-
items: {
114-
padding: 0,
115-
},
116-
},
117-
dataLabels: {
118-
enabled: false,
119-
},
120-
stroke: {
121-
curve: "straight",
122-
width: 1.7,
123-
},
124-
series: getSeries(props.downloads, "weekly"),
125-
xaxis: {
126-
type: "datetime",
127-
tooltip: {
128-
enabled: false,
129-
},
130-
},
131-
responsive: [
132-
{
133-
breakpoint: 768,
134-
options: {
135-
legend: {
136-
horizontalAlign: "left",
137-
},
138-
},
139-
},
140-
],
141-
});
142104
const isDarkMode = document.documentElement.classList.contains("dark");
143105

144106
chartRef.current = new ApexCharts(

0 commit comments

Comments
 (0)