Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

112
Views
Use ViewChild for dynamic instances

Here I'm using devextreme library for charts in my angular project. When I want to export my chart, for example if I have a chart of like 40 columns(bars) then I want to break it into multiple instances each displaying 10 columns so that entire data could be viewed inside single exported file. Here I've used @ViewChild(DxChartComponent, { static: false }) chart: DxChartComponent. In the onExporting function I am changing the visual range and I want to save separately each new instance of chart so that I could export all different instances in a single file. How can I have multiple instances to export?

@ViewChild(DxChartComponent, { static: false }) chart: DxChartComponent;


export(i) {
        const chartInstance = this.chart.instance;
        exportWidgets([[chartInstance]], {
            fileName: `Page${i + 1}`,
            format: 'PNG',
        });
      }

    onExporting(e) {
        e.cancel = true;
        this.currentRange = e.component.getArgumentAxis().visualRange();
        console.log(e.component.getArgumentAxis().visualRange());
        for (let i = 0; i < Math.ceil(this.dataSource.length / 12); i++) {
            e.component.getArgumentAxis().visualRange({startValue: this.dataSource[this.startingPoint].firstSection, length: 12});
            console.log(e.component.getArgumentAxis().visualRange());
            this.export(i);
            this.startingPoint += 12;
        }
      }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!