<jupyter_start><jupyter_text>Aggregate/drill-downThese features basically mean that you add or remove an additional dimension to/from an axis or another channel. As you can see below, there are some important things to keep in mind when you use them.Let’s stack together the elements by putting the Genres dimension from the x-axis to the y-axis. At the end of this phase, there are chart elements with the same color stacked on top of each other, which is something you would want to avoid. **Note:** The data used in this tutorial is available [here](https://github.com/vizzuhq/ipyvizzu/blob/gh-pages/docs/tutorial/music_data.json). You can read more about the available types of data in the [Adding data](./01_02_adding_data.ipynb) chapter.<jupyter_code>from ipyvizzu import Chart, Data, Config

chart = Chart()

data = Data.from_json("./music_data.json")

chart.animate(data)

chart.animate(
    Config(
        {
            "channels": {
                "y": {"set": ["Popularity", "Kinds"]},
                "x": {"set": "Genres"},
                "label": {"attach": "Popularity"},
            },
            "color": {"attach": "Kinds"},
            "title": "Stack",
        }
    )
)

chart.animate(
    Config(
        {
            "channels": {
                "y": {
                    "attach": "Genres",
                },
                "x": {"set": None},
            }
        }
    )
)

snapshot1 = chart.store()<jupyter_output><empty_output><jupyter_text>By taking the Genres off of the y-axis, only one chart element remains for every color, and Vizzu automatically calculates and shows the aggregate value of the elements.**Note:** Instead of taking the unwanted dimension down from the chart, Genres could have been added to the lightness channel to differentiate the chart elements.<jupyter_code>chart.animate(snapshot1)

chart.animate(Config({"title": "Aggregate element"}))

chart.animate(
    Config(
        {
            "channels": {
                "y": {
                    "detach": "Genres",
                },
            }
        }
    )
)

snapshot2 = chart.store()<jupyter_output><empty_output><jupyter_text>To drill-down, the same dimension is put back on the y-axis, which results in a state that we suggest you to only use temporarily when in transition.<jupyter_code>chart.animate(snapshot2)

chart.animate(Config({"title": "Drill-down"}))

chart.animate(
    Config(
        {
            "channels": {
                "y": {
                    "attach": "Genres",
                },
            }
        }
    )
)

snapshot3 = chart.store()<jupyter_output><empty_output><jupyter_text>We group the elements by putting once again the Genres dimension on the x-axis.<jupyter_code>chart.animate(snapshot3)

chart.animate(Config({"title": "Group"}))

chart.animate(
    Config(
        {
            "channels": {
                "y": {
                    "detach": "Genres",
                },
                "x": {
                    "set": "Genres",
                },
            }
        }
    )
)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11547194291274733, 'fraction_numerical': 0.003243593902043464, 'mean_word_length': 2.1925465838509317, 'pattern_counts': {'":': 29, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '114141', 'license': 'Apache-2.0', 'n_tokens_mistral': 911, 'n_tokens_neox': 875, 'n_words': 266, 'path': 'docs/tutorial/01_09_aggregate_drilldown.ipynb', 'repo_name': 'vizzuhq/pyvizzu', 'size': '3083'}