Skip to content

Commit

Permalink
implement boring mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zack committed Jul 20, 2024
1 parent f559465 commit 537a847
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/Chart.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { NamedChartData } from './DataContainer';
import React from 'react';
import { useSearchParams } from 'next/navigation';

import {
Bar,
Expand All @@ -23,6 +24,9 @@ export default function Chart({
daily: boolean;
chartData: NamedChartData[];
}) {
const searchParams = useSearchParams();
const boring = searchParams.get('boring');

const getMaxValueInData = React.useCallback(() => {
return chartData.reduce((memo, val) => {
const valSum = val.acoustic + val.electric;
Expand Down Expand Up @@ -150,7 +154,12 @@ export default function Chart({
<span style={{ fontSize: '1.5rem', color: '#000' }}> {value} </span>
)}
/>
<Bar dataKey='acoustic' stackId='a' fill='#0150B4' />
<Bar
dataKey='acoustic'
name={boring ? 'classic' : undefined}
stackId='a'
fill='#0150B4'
/>
<Bar dataKey='electric' stackId='a' fill='#C1BFBB' />
</BarChart>
</ResponsiveContainer>
Expand Down

0 comments on commit 537a847

Please sign in to comment.