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

(docs) Sankey Diagram - Custom Colors Not Working #1988

Open
tonyawad88 opened this issue Jan 18, 2025 · 0 comments
Open

(docs) Sankey Diagram - Custom Colors Not Working #1988

tonyawad88 opened this issue Jan 18, 2025 · 0 comments

Comments

@tonyawad88
Copy link

Hello,

I am trying to create a sankey diagram with custom colors but it isn't taking effect. Any thoughts are greatly appreciated. 🙏

<ngx-charts-sankey
  class="chart-container"
  [results]="sankeyData"
  [schemeType]="schemeType"
  [scheme]="colorScheme"
  [customColors]="customColors"
  [showLabels]="true"
  [animations]="true"
</ngx-charts-sankey>
sankeyData = [
  { source: 'a', target: 'b', value: 50 },
  { source: 'b', target: 'c', value: 50 },
];
schemeType = ScaleType.Ordinal;
colorScheme: Color = {
  domain: [],
  group: ScaleType.Ordinal,
  selectable: true, // => boolean (true / false)
  name: 'x',
};
customColors: any[] = [
  {
    name: 'a',
    value: '#ff0000'
  },
  {
    name: 'b',
    value: '#ff0000'
  },
  {
    name: 'c',
    value: '#ff0000'
  }
];
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