Skip to content

Commit

Permalink
fix: Resolves incorrect search trend graph in Ideas section.
Browse files Browse the repository at this point in the history
closes #219
  • Loading branch information
towfiqi committed Nov 8, 2024
1 parent 4b8730e commit 7597210
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions components/common/ChartSlim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@ ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, Filler,
type ChartProps ={
labels: string[],
sreies: number[],
noMaxLimit?: boolean
noMaxLimit?: boolean,
reverse?: boolean
}

const ChartSlim = ({ labels, sreies, noMaxLimit = false }:ChartProps) => {
const ChartSlim = ({ labels, sreies, noMaxLimit = false, reverse = true }:ChartProps) => {
const options = {
responsive: true,
maintainAspectRatio: false,
animation: false as const,
scales: {
y: {
display: false,
reverse: true,
reverse,
min: 1,
max: noMaxLimit ? undefined : 100,
},
Expand Down
2 changes: 1 addition & 1 deletion components/ideas/KeywordIdea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const KeywordIdea = (props: KeywordIdeaProps) => {
onClick={() => showKeywordDetails()}
className={`keyword_visits text-center hidden mt-4 mr-5 ml-5 cursor-pointer
lg:flex-1 lg:m-0 lg:ml-10 max-w-[70px] lg:max-w-none lg:pr-5 lg:flex justify-center`}>
{chartData.labels.length > 0 && <ChartSlim labels={chartData.labels} sreies={chartData.sreies} noMaxLimit={true} />}
{chartData.labels.length > 0 && <ChartSlim labels={chartData.labels} sreies={chartData.sreies} noMaxLimit={true} reverse={false} />}
</div>

<div className='keyword_ctr text-center inline-block ml-4 lg:flex mt-4 relative lg:flex-1 lg:m-0 justify-center'>
Expand Down

0 comments on commit 7597210

Please sign in to comment.