Skip to content

Pie chart with Text Color doesn't change #3325

Discussion options

You must be logged in to vote

It seems like this may be a bug related to changing the color: #2909 (comment)
Does the following produce the desired chart? I added order=alt.Order(field="category") based on what was suggested in the above linked comment.

import pandas as pd
import altair as alt

data = pd.DataFrame({
      'category': ['A', 'B', 'C', 'D'],
      'value': [25, 30, 15, 30],
      'apple_sold': [True, False, True, False]
  })
chart_pic = alt.Chart(data).mark_arc(outerRadius=120).encode(
  theta=alt.Theta('value', stack=True),
  color=alt.Color('category')
)
text = chart_pic.mark_text(radius=100, size=20, align='center').encode(
  text=alt.Text('value'),
  color=alt.value('white'),
  order=alt.Order(field=…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@levinaanora
Comment options

@ChristopherDavisUCI
Comment options

Answer selected by levinaanora
@levinaanora
Comment options

@ChristopherDavisUCI
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants