Mustafa Dikici
08/28/2024, 3:43 PMRadek Novacek
08/30/2024, 10:39 AMMustafa Dikici
08/30/2024, 11:52 AMMustafa Dikici
09/05/2024, 11:13 AMRadek Novacek
09/05/2024, 11:17 AMMustafa Dikici
09/05/2024, 11:37 AMMustafa Dikici
09/05/2024, 11:38 AMRadek Novacek
09/05/2024, 11:41 AMMustafa Dikici
09/05/2024, 11:45 AMMartin Burian
09/12/2024, 6:47 PMtrendBy
state is updated based on the selection.
3. The LineChart
re-renders with the updated trendBy
value.
The Chart switch does something similar and changes different properties of the visual components.
Please let me know if it helped.Martin Burian
09/12/2024, 7:22 PMMustafa Dikici
09/13/2024, 12:12 PMMartin Burian
09/15/2024, 6:52 PMtrendBy
attribute. To enable changing the trendBy
attribute in your LineChart based on a dropdown selection, you need to introduce state management using React useState
hook. Initialize a state variable for trendBy
with a default value, create a dropdown menu that lists the available date granularities, and update the trendBy
state when the user selects a different option. By passing this state variable to the LineChart as the trendBy
prop, the chart will automatically re-render to reflect the new date granularity whenever the state changes.Martin Burian
09/15/2024, 7:07 PMconst exampleLineChart = () => {
const [trendBy, setTrendBy] = useState(Md.DateMonth.Short);
....
Then write a handler for the dropdown to call setTrendBy
with the selected value. Add a dropdown in the return statement and set its onChange
to this handler. Finally, render the LineChart
, passing trendBy
as a prop.Mustafa Dikici
09/16/2024, 8:09 AMwithCustomProvider
or withCustomDecorator
, get the existing plugin state and modify it?Martin Burian
09/16/2024, 2:35 PMMartin Burian
09/17/2024, 1:16 PMwithCustomProvider
to customize or better to say to replace an insight with a custom one providing the functionality you need. You can get some inspiration here: https://github.com/gooddata/gooddata-dashboard-plugins/blob/master/radial_bar_chart_plugin/src/dp_radial_bar_chart_plugin/Plugin.tsx#L29Martin Burian
09/17/2024, 1:17 PM