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

[Question]: How can I get the all the bar elements inside <svg><path> to do customization? #1786

Open
1 task done
rajaa1985 opened this issue Feb 29, 2024 · 0 comments
Open
1 task done

Comments

@rajaa1985
Copy link

rajaa1985 commented Feb 29, 2024

Question for Carbon

I am working with Angular15 and Carbon Design System.

Do we have any options to get all the bar elements in to customize something programmatically. Want to iterate individual (bars) elements.

Below is the current implementation

HTML


<div>
    <ibm-simple-bar-chart [data]="chartData" [options]="chartOptions" #simpleBar></ibm-simple-bar-chart>
</div>

bar-chart.component.ts

import {AfterViewInit, Component, ViewChild} from '@angular/core';

 @Component({
  selector: 'bar-chart',
  templateUrl: './bar-chart.component.html',
  styleUrls: [],
 })
 export class SimpleBarChartComponent implements AfterViewInit {
 public chartData: any[] = [];
 public chartOptions: any = {};
 @ViewChild('simpleBar', {static: false})
 public barChart: any;

 public ngAfterViewInit(): void {
    if (this.barChart) {
      // I want to perform custom logic here
    }
  }
 }

Note: Actually trying to show some vertical text next to each bars.
Screenshot 2024-02-29 at 7 30 09 AM

I don't find any options so try to get the element and customize it

If I am able to get the element then it will be good for me to do any customization

Code of Conduct

@tay1orjones tay1orjones transferred this issue from carbon-design-system/carbon Mar 4, 2024
@Akshat55 Akshat55 transferred this issue from carbon-design-system/carbon-components-angular Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant