Dynamic Bar Chart Configurator
Data analysts often need to quickly visualize raw data to identify trends and patterns. This problem focuses on building a crucial component for our internal analytics platform: a dynamic chart configurator. This component allows users to interactively define the structure and basic aesthetics of a bar chart from a given dataset, making data exploration intuitive and efficient.
Your primary task is to build a React component, ChartConfigurator, that enables users to configure a simple bar chart. The component should provide controls to select the primary dimension for the X-axis, the metric for the Y-axis, and a custom color for the bars.
ChartConfigurator component that encapsulates the configuration logic and UI.<select> dropdowns) for:
availableDimensions).availableMetrics).<label>, <select>, <input>) for accessibility.ChartConfigurator component renders successfully without errors.availableDimensions and availableMetrics data respectively.Constraints
mockRawData), a list of availableDimensions, and availableMetrics. You do not need to fetch data or derive these lists dynamically from mockRawData.barColor input can be a simple text field; no need for a full-fledged color picker component.useState, useEffect) to manage component state and side effects.Loading editor...