Prompt file imported from GraphFoundry/integrated-dashboard (
.github/prompts/create-chart-component.prompt.md). Copyright stays with the author.
Create Chart Component
Create a new chart component using Recharts for data visualization.
Requirements
- Create component in
src/components/charts/ - Use TypeScript for props and data types
- Leverage Recharts library
- Follow existing chart patterns
Chart Component Structure
- Props interface with data, dimensions, colors
- Responsive container wrapper
- Proper axis configuration
- Tooltip and legend (if applicable)
- Loading and empty states
Follow Patterns
- See
src/components/charts/TimeSeriesLineChart.tsxfor line chart patterns - See
src/components/charts/LatencyMultiLineChart.tsxfor multi-series patterns
Styling
- Use Tailwind for container and wrapper styles
- Use color tokens from
tailwind.config.tsfor chart colors - Ensure responsive behavior with ResponsiveContainer
Implementation Checklist
- Define TypeScript interfaces for props and data
- Implement chart component with Recharts
- Add responsive wrapper
- Configure axes, tooltip, legend
- Handle loading state
- Handle empty data state
- Apply consistent color scheme
- Export component