Hello team, we are developing custom plugins for o...
# gooddata-ui
m
Hello team, we are developing custom plugins for our dashboards. So far I could setup, run, export catalog and render the charts we needed. Problem is when i pass data to the charts , it is not filtered by page filters, all data comes without any filter. I see chart components has a
filter
prop but i could not find how am i going to get current filters on dashboard. My question is how can i get/apply current filters of dashboard when developing plugins? Are there any examples I can have a look? Cheers!
f
Hi Mustafa! I think this example from GD.UI’s example gallery illustrates what you’re looking for here. It’s using a dashboard component and a custom plugin, added as an additional section of the dashboard, to which its filters apply. Would that help?
m
Hey Fransisco, thanks for your support. I am sorry but this example does not explain a lot. I have some questions: I try to render a chart:
Copy code
<ComboChart
          primaryMeasures={[Md.Payments]}
          viewBy={[Md.DateDatasets.CreatedAt.CreatedAtDayOfYear.Default]}
          config={{ legend: { enabled: false } }}
        />
and this is how i register:
Copy code
newDashboardItem(
            newCustomWidget('myWidget1', 'myCustomWidget', {
              dateDataSet: Md.DateDatasets.CreatedAt,
              ignoreDashboardFilters: [],
            }),
            {
              xl: {
                gridWidth: 12,
                gridHeight: 1,
              },
            }
          )
in the example above date filters are not applied on chart. For filtered data should i use
useCustomWidgetExecutionDataView
always? i am trying to fetch data like below
Copy code
const dataViewTask = useCustomWidgetExecutionDataView({
    widget: widget,
    execution: {
      seriesBy: [Md.Payments],
      slicesBy: [Md.DateDatasets.CreatedAt.CreatedAtDayOfYear.Default],
    },
  });
but still date filters are not applied
f
Thanks for the reply and the additional examples! I’ll discuss this one internally and we’ll get back to you as soon as we can with more details. Thank you!
j
Hello Mustafa, Thank you for bring it to our attention. My name is Jakub and I'll assist you as L2 engineer. Let me go through your query and I'll come back to you soon with my answers.
m
Hello Jakub, thank you very much!
j
pleasure on my side!