Topic: Chart Update in real time
Flávio Tobias free asked 6 years ago
I'm looking for a chart to use in my Angular project, I found the mdbChart and I'd like it. However I run a test on it and I was not able to update it in real time. I have some data index by time. The user can define the time interval which he wants to see. The charts opens the first dataset, but when I change the time period the data are updated however the legend and labels are not updated, it stays the same as for the first dataset.
Is it possible to change the chart legend and label in real time?
I used the example on MDB page to build my test.
I'm updating the chartDatasets and chartLabels attributes in real time.
<canvas mdbChart
[chartType]="chartType"
[datasets]="chartDatasets"
[labels]="chartLabels"
[options]="chartOptions"
[legend]="true"
(chartHover)="chartHovered($event)"
(chartClick)="chartClicked($event)">
</canvas>
Thanks
Flavio
Add comment
ak.leimrey pro answered 6 years ago
From my own experience, it IS possible but you have to programmatically reassign the new values to update your chart. No big hassle. Also, this chart component is not from mdb, despite the name. It's merely a fork of ng2-charts which is simply a type-script comform fork of chart.js
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Resolved
Specification of the issue
- ForumUser: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Tags