Overview
Our internal analytics dashboard needs a flexible way for users to quickly visualize data. This problem focuses on building a core component of a 'Chart Builder' tool: a configurable bar chart. The goal is to allow users to dynamically adjust key properties of the chart, such as its title and axis labels, and see these changes reflected in real-time.
What you need to do / Task
Your primary task is to create a React component that displays a simple bar chart and allows for its basic configuration.
- Initial Render: Display a bar chart using the provided mock data.
- Configuration Controls: Implement input fields for the user to configure the following chart properties:
- Chart Title: A text input for the main title of the chart.
- X-Axis Label: A text input for the label displayed along the X-axis.
- Y-Axis Label: A text input for the label displayed along the Y-axis.
- Dynamic Updates: As the user types into the configuration input fields, the corresponding chart elements (title, X-axis label, Y-axis label) must update instantaneously.
- Bar Styling: Ensure the bars are rendered with heights proportional to their values and have a distinct color. You can use a single, configurable color for all bars (e.g., a color input or a simple dropdown with a few options).
UI/UX expectations
- The application should have a clear layout, separating the configuration controls from the rendered chart. A common pattern is controls on one side/top and the chart display area on the other side/bottom.
- Input fields should be clearly labeled and functional.
- The bar chart itself should be visually distinct, with bars clearly representing data values. Basic styling for labels and bars is sufficient.
Acceptance criteria
- The application loads and displays an initial bar chart with the mock data.
- The chart includes an initial title, X-axis label, and Y-axis label.
- Changing the text in the 'Chart Title' input field immediately updates the chart's title.
- Changing the text in the 'X-Axis Label' input field immediately updates the X-axis label on the chart.
- Changing the text in the 'Y-Axis Label' input field immediately updates the Y-axis label on the chart.
- Bars are rendered with heights proportional to their values and a consistent, visible color.