Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simple-charts-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mahesh Maddhuru
simple-charts-frontend
Commits
e77adfe7
Commit
e77adfe7
authored
1 year ago
by
Nikhil Ram
Browse files
Options
Downloads
Patches
Plain Diff
final stylings
parent
c2513cb1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/choose-chart-sample/select-chart.tsx
+16
-41
16 additions, 41 deletions
src/components/choose-chart-sample/select-chart.tsx
with
16 additions
and
41 deletions
src/components/choose-chart-sample/select-chart.tsx
+
16
−
41
View file @
e77adfe7
// "use client";
// import DefaultLayout from "@/components/Layouts/DefaultLayout";
// import { useRouter, usePathname, useSearchParams} from 'next/navigation';
// import React, { useEffect } from "react";
// const SelectChart: React.FC = () => {
// const router = useRouter();
// //get the query parameters - id here
// const pathname = usePathname()
// const searchParams = useSearchParams()
// useEffect(() => {
// const url = `${pathname}?${searchParams}`
// console.log(url)
// // You can now use the current URL
// // ...
// }, [pathname, searchParams])
// // You can use id, name, and description here to render the details
// return (
// <DefaultLayout>
// <div>
// <h1>Choose Chart</h1>
// </div>
// </DefaultLayout>
// );
// };
// export default SelectChart;
import
{
useRouter
,
usePathname
,
useSearchParams
}
from
'
next/navigation
'
;
...
...
@@ -43,13 +11,17 @@ const SelectChart: React.FC = () => {
<
DefaultLayout
>
<
div
>
<
div
style
=
{
{
display
:
'
flex
'
,
flexWrap
:
'
wrap
'
,
justifyContent
:
'
center
'
}
}
>
<<
<<
<<
<
Updated
upstream
<
ChartOptionCard
chartType
=
"
Bar Chart
"
/>
<
ChartOptionCard
chartType
=
"Line Chart"
/>
<
ChartOptionCard
chartType
=
"Pie Chart"
/>
<
ChartOptionCard
chartType
=
"Scatter Chart"
/>
<
ChartOptionCard
chartType
=
"Area Chart"
/>
=======
<
h2
>
<
strong
>
Choose a chart type
</
strong
>
</
h2
>
<
p
>
It is important to choose the type of visualization fits your data
best. Choose the chart type that represents your data accurately or
pick the recommended type.
</
p
>
<
br
/>
<
ChartOptionCard
chartType
=
"Bar Chart"
description
=
"Comparisons"
/>
<
ChartOptionCard
chartType
=
"Line Chart"
description
=
"Trends over time"
/>
<
ChartOptionCard
chartType
=
"Pie Chart"
description
=
"Proportions"
/>
...
...
@@ -58,7 +30,6 @@ const SelectChart: React.FC = () => {
<
ChartOptionCard
chartType
=
"TreeMap Chart"
description
=
"Hierarchical data"
/>
<
ChartOptionCard
chartType
=
"Funnel Chart"
description
=
"Sales process"
/>
<
ChartOptionCard
chartType
=
"Radar Chart"
description
=
"Comparisons"
/>
>>>>>>>
Stashed
changes
{
/* Add more chart options as needed */
}
</
div
>
</
div
>
...
...
@@ -66,7 +37,7 @@ const SelectChart: React.FC = () => {
);
};
const ChartOptionCard: React.FC
<
{
chartType
:
string
}
>
= (
{
chartType
}
) =>
{
const
ChartOptionCard
:
React
.
FC
<
{
chartType
:
string
,
description
:
string
}
>
=
({
chartType
,
description
})
=>
{
const
router
=
useRouter
();
const
searchParams
=
useSearchParams
()
const
handleChartSelection
=
()
=>
{
...
...
@@ -90,7 +61,11 @@ const ChartOptionCard: React.FC<{ chartType: string }> = ({ chartType }) => {
/>
<
Typography
variant
=
"h6"
component
=
"h2"
>
{
chartType
}
<
br
/>
{
description
}
</
Typography
>
</
CardContent
>
</
Card
>
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment