Skip to main content

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!!

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.parametersr'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.


Reply