
:orphan:
:html_theme.sidebar_secondary.remove:

.. This document is auto-generated by the altair-gallery extension. Do not modify directly.

.. _gallery_area_faceted:


Faceted Area Chart
------------------
Multiple area subcharts, one for each company.
We also show filtering out one of the companies,
and sorting the companies in a custom order.


.. altair-plot::
    :remove-code:
    


    import altair as alt
    from altair.datasets import data

    source = data.stocks()

    alt.Chart(source).transform_filter(
        alt.datum.symbol != "GOOG",
    ).mark_area().encode(
        x="date:T",
        y="price:Q",
        color="symbol:N",
        row=alt.Row("symbol:N", sort=["MSFT", "AAPL", "IBM", "AMZN"]),
    ).properties(height=50, width=400)


.. tab-set::

    .. tab-item:: Method syntax
        :sync: method

        .. code:: python


            import altair as alt
            from altair.datasets import data

            source = data.stocks()

            alt.Chart(source).transform_filter(alt.datum.symbol != "GOOG").mark_area().encode(
                x="date:T",
                y="price:Q",
                color="symbol:N",
                row=alt.Row("symbol:N").sort(["MSFT", "AAPL", "IBM", "AMZN"]),
            ).properties(height=50, width=400)


    .. tab-item:: Attribute syntax
        :sync: attribute

        .. code:: python


            import altair as alt
            from altair.datasets import data

            source = data.stocks()

            alt.Chart(source).transform_filter(
                alt.datum.symbol != "GOOG",
            ).mark_area().encode(
                x="date:T",
                y="price:Q",
                color="symbol:N",
                row=alt.Row("symbol:N", sort=["MSFT", "AAPL", "IBM", "AMZN"]),
            ).properties(height=50, width=400)
