-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
PrimeNG Charts do not change the values after they have already been #514
Comments
Same here |
did you solve it? |
the same thing for me |
I'm using beta.9 :/ |
Anyone solved it? Maybe Thinking on changing of library... |
I don´t solve this! I´m wait for... I´m in Beta 9 too. PrimeNg fprum problem: http://forum.primefaces.org/viewtopic.php?f=35&t=46104 |
any progress? |
No. |
i tried using these charts and they work just fine. but without the updating on datachange they're pretty much useless. this should be a high prio bug.. what good are static charts in any dashboard .. |
primeng ui chart is just a wrapper component for chart.js chart. I've managed to find the reason of this bug there - they use itterable differs in ngDoCheck - and as a result data value is already set but still not rerendered. one can find UiChart in node modules folder and find that condition in ngDoCheck method (or just open this component in chrome debug tool and put break into ngDoCheck method). The only way to fix this I found was to create the custom wrapper. Btw, this solution was good because there're known bugs in chart.js (espessially if you change visibility of chart holder) - so I created the wrapper for highcharts not for chart.js. And of course this approach can be used for any charts library one likes. |
try... after changing something in Dataset[0] refresh Object for this series
|
it seems to me that the problem was solved. Updated version of PrimeNG and now works normally. |
I am still having that problem. I am updateing my chartdata.datasets and my p-chart does not update. I'd love to see your code.
Whereas ntwdata is an imported variable for my chart and the pingService delivers a number every 2.5secs. Any ideas? I am using the latest versions of Angular2, Chart.js and PrimeNG. |
same here. it does not seem to work. i am using beta 16. |
You have to update the dom elements, manually. In documentation it says, 'due to complexity of charts.js, change detection is not available and when the data changes, you need to call refresh() method manually'. For instance if you increase width of chart container element, the chart should update. It's a hack but should work if updating to latest doesn't work. |
ChangeDetection added for charts. Take a look at this one; Without changing the array there should be manual refresh method on your chart. |
[NNTR-524]moved the PDF icon
My Chars are functioning normally, but when I try to modify the values after the graphic has already been generated it does not change
MY TS FILE:
`import {Component, OnInit, ApplicationRef} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {Analise, Filtro} from './analytics.class';
import {AnalyticsService} from './analytics.service';
import {UsiGoDirective} from '../utils/directives/usi-go.directive';
import {CardComponent} from '../utils/components/card.component';
import {BbNl2BrPipe} from '../utils/pipes/bb-nl2br.pipe';
import {DataTable, Column, Calendar, UIChart} from 'primeng/primeng';
@component({
templateUrl: './analytics/analytics.page.html',
styleUrls: ['./analytics/analytics.page.css'],
directives: [UsiGoDirective, DataTable, Column, Calendar, UIChart],
pipes: [BbNl2BrPipe],
providers: [AnalyticsService]
})
export class AnalyticsPage implements OnInit {
}
`
MYHTML FILE:
. . . <p-chart type="line" [data]="data"></p-chart> . . .
Link forum: http://forum.primefaces.org/viewtopic.php?f=35&t=46104&sid=15474b87ed77b0eda44a74d7224ea3e8
The text was updated successfully, but these errors were encountered: