:orphan:
:html_theme.sidebar_secondary.remove:
.. This document is auto-generated by the altair-gallery extension. Do not modify directly.
.. _gallery_pacman_chart:
Pacman Chart
------------
Chart made using ``mark_arc`` and constant values.
This could also be made using
``alt.Chart(source).mark_arc(color = "gold", theta = (5/8)*np.pi, theta2 = (19/8)*np.pi,radius=100)``.
.. altair-plot::
:remove-code:
import numpy as np
import altair as alt
alt.Chart().mark_arc(color="gold").encode(
theta=alt.datum((5 / 8) * np.pi, scale=None),
theta2=alt.datum((19 / 8) * np.pi),
radius=alt.datum(100, scale=None),
)
.. tab-set::
.. tab-item:: Method syntax
:sync: method
.. code:: python
import numpy as np
import altair as alt
alt.Chart().mark_arc(color="gold").encode(
theta=alt.ThetaDatum((5 / 8) * np.pi).scale(None),
theta2=alt.Theta2Datum((19 / 8) * np.pi),
radius=alt.RadiusDatum(100).scale(None),
)
.. tab-item:: Attribute syntax
:sync: attribute
.. code:: python
import numpy as np
import altair as alt
alt.Chart().mark_arc(color="gold").encode(
theta=alt.datum((5 / 8) * np.pi, scale=None),
theta2=alt.datum((19 / 8) * np.pi),
radius=alt.datum(100, scale=None),
)