Skip to main content
Solved

Series breakdown: unselect some facet values per default

  • May 2, 2025
  • 2 replies
  • 19 views

I want to display the evolution of population in all districts of Würzburg with a line chart. For that I use this dataset.
In order to compare the districts, I created a series-breakdown on “Stadtbezirk” facet. But since there are 13 districts, this looks a little bit confusing. 
At the moment, one could unselect several districts by hand by clicking on them in the legend. In this case, it would be more convenient, if there are all but a one ore two districts unselected by default.

Is there any possibility to implement this in the HTML or CSS-Code?

At the moment, the code for the chart looks like this:

<ods-dataset-context context="stadtbezirkehauptwohnsitzaltersgruppen" stadtbezirkehauptwohnsitzaltersgruppen-dataset="stadtbezirke_hauptwohnsitz_altersgruppen">
<ods-chart scientific-display="false" align-month="true">
<ods-chart-query context="stadtbezirkehauptwohnsitzaltersgruppen" field-x="jahr" maxpoints="0" timescale="year" series-breakdown="stadtbezirk">
<ods-chart-serie expression-y="wert" chart-type="line" function-y="SUM" color="range-Accent" scientific-display="true">
</ods-chart-serie>
</ods-chart-query>
</ods-chart>

</ods-dataset-context>

Thanks for your help!!

Best answer by Thomas R.

Hello,
 

A solution for your issue would be to use a filter before your graph to avoid displaying all the different districts all at once, here is a code that could work : 

<ods-dataset-context context="stadtbezirkehauptwohnsitzaltersgruppen,filtert" stadtbezirkehauptwohnsitzaltersgruppen-dataset="stadtbezirke_hauptwohnsitz_altersgruppen" filtert-dataset="stadtbezirke_hauptwohnsitz_altersgruppen" stadtbezirkehauptwohnsitzaltersgruppen-parameters="{'disjunctive.stadtbezirk': true,'refine.stadtbezirk':['Altstadt','Duerrbachtal','Frauenland']}" filtert-parameters="{'disjunctive.stadtbezirk': true}">
<div ods-adv-analysis="stadtbezirkSelect" ods-adv-analysis-context="filtert" ods-adv-analysis-group-by="stadtbezirk" ods-adv-analysis-select="stadtbezirk" ods-adv-analysis-order-by="stadtbezirk" ods-adv-analysis-limit="3000">
<ods-select selected-values="stadtbezirkehauptwohnsitzaltersgruppen.parameters['refine.stadtbezirk']" multiple="true" options="stadtbezirkSelect" label-modifier="stadtbezirk" value-modifier="stadtbezirk" placeholder="Stadtbezirk"></ods-select>
</div>
<ods-chart scientific-display="false" align-month="true">
<ods-chart-query context="stadtbezirkehauptwohnsitzaltersgruppen" field-x="jahr" maxpoints="0" timescale="year" series-breakdown="stadtbezirk">
<ods-chart-serie expression-y="wert" chart-type="line" function-y="SUM" color="range-Accent" scientific-display="true"></ods-chart-serie>
</ods-chart-query>
</ods-chart>
</ods-dataset-context>

 

I added a filtering context which feeds into an analysis which results then are used by a select which filters the context of the graph which can be interacted with to add or remove different districts to the map. In this example I chose to display the first three districts alphabetically through the parameters of the graph’s context.

 

Hope that solution works for you.

2 replies

Thomas R.
Huwise Team
  • Huwise Team
  • 6 replies
  • Answer
  • June 12, 2025

Hello,
 

A solution for your issue would be to use a filter before your graph to avoid displaying all the different districts all at once, here is a code that could work : 

<ods-dataset-context context="stadtbezirkehauptwohnsitzaltersgruppen,filtert" stadtbezirkehauptwohnsitzaltersgruppen-dataset="stadtbezirke_hauptwohnsitz_altersgruppen" filtert-dataset="stadtbezirke_hauptwohnsitz_altersgruppen" stadtbezirkehauptwohnsitzaltersgruppen-parameters="{'disjunctive.stadtbezirk': true,'refine.stadtbezirk':['Altstadt','Duerrbachtal','Frauenland']}" filtert-parameters="{'disjunctive.stadtbezirk': true}">
<div ods-adv-analysis="stadtbezirkSelect" ods-adv-analysis-context="filtert" ods-adv-analysis-group-by="stadtbezirk" ods-adv-analysis-select="stadtbezirk" ods-adv-analysis-order-by="stadtbezirk" ods-adv-analysis-limit="3000">
<ods-select selected-values="stadtbezirkehauptwohnsitzaltersgruppen.parameters['refine.stadtbezirk']" multiple="true" options="stadtbezirkSelect" label-modifier="stadtbezirk" value-modifier="stadtbezirk" placeholder="Stadtbezirk"></ods-select>
</div>
<ods-chart scientific-display="false" align-month="true">
<ods-chart-query context="stadtbezirkehauptwohnsitzaltersgruppen" field-x="jahr" maxpoints="0" timescale="year" series-breakdown="stadtbezirk">
<ods-chart-serie expression-y="wert" chart-type="line" function-y="SUM" color="range-Accent" scientific-display="true"></ods-chart-serie>
</ods-chart-query>
</ods-chart>
</ods-dataset-context>

 

I added a filtering context which feeds into an analysis which results then are used by a select which filters the context of the graph which can be interacted with to add or remove different districts to the map. In this example I chose to display the first three districts alphabetically through the parameters of the graph’s context.

 

Hope that solution works for you.


  • Author
  • Seeker
  • 3 replies
  • June 25, 2025

Hi Thomas,

thank you for your answer!
It’s not directly what I meant, but it’s a nice workaround. I will definitely think about implementing it like this :)

Best regards
Domi