Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot normalize a stacked bar #172

Open
Ying456123 opened this issue Aug 27, 2019 · 0 comments
Open

Cannot normalize a stacked bar #172

Ying456123 opened this issue Aug 27, 2019 · 0 comments

Comments

@Ying456123
Copy link

After I added stacked=StackOffset.Normalize configuration, it still doesn't change much. Does anyone have good advice about how to normalize this bar?
Below is my code:

val data = Seq(
      ("te1", 300.0, 17.0),
      ("te2", 50.0, 19.0),
      ("te1", 40.2, 21.3),
      ("te2", 15.0, 21.5)
    )

val df = spark.createDataFrame(data).toDF("col", "data1", "data2")
Vegas().
  withDataFrame(df).
  mark(Bar).
  encodeY("data1", Quant).
  encodeColor("col", Nominal).
  configMark(stacked=StackOffset.Normalize).
  show

The showed image is:
image
It doesn't show the percentage for each data. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant