ngx-charts

Input property does not work within ngx-charts template

两盒软妹~` 提交于 2019-12-12 12:11:22
问题 As per this answer I did come up with code below that works fine: result: any; ngOnInit() { this.result = getResult(); } <ngx-charts-bar-vertical-stacked *ngIf="(result | async) as results" [results]="results" > </ngx-charts-bar-vertical-stacked> Now I want to pass result as an input parameter: @Input() result: any; <ngx-charts-bar-vertical-stacked *ngIf="(result| async) as results" [results]="results" > </ngx-charts-bar-vertical-stacked> but it is just does not work this way, the chart just

Ngx-charts can't load line chart from feed correctly, works with local file

折月煮酒 提交于 2019-12-11 07:29:31
问题 I am having a char initialised. Works good so configuration is properly set up and dependency installed. I followed example for line-chart and used data provided here: https://swimlane.gitbooks.io/ngx-charts/content/charts/line-chart.html Works correctly. Problem is when I load a data from API feed, my graph acts strange, tooltip is not disappearing and whatever route i click it loads in same window, aka something is broken: Now this is the data from feed: { "currentWeight": 80,

Ngx-charts can't load bar charts directly with async pipe in angular

ε祈祈猫儿з 提交于 2019-12-07 17:37:25
My problem is similar to this stackoverflow post When I use async pipe to observe data from firebase and show it in chart, I can see the chart but prompt null error in console. Without async pipe, all errors are gone but I can't fetch data (duh it's async data). Help me please. Cause This is happening because the component cannot work with null values for results . Why? Async pipe is, as you say, used when you do not want to (or do not need to) subscribe in the component code, but do it in the template instead. Pipe, however, is a pure function: is has to return something each time it's called

Angular ngx-charts options for customizing the Legend?

霸气de小男生 提交于 2019-12-06 23:39:57
问题 I am currently using ngx-charts for Angular2, and I would like to customize some legends, e.g. place the legend below the chart, or rename the legend fields, or make the legend wider (parts of the text just gets cut off..) etc. Are there any good options to customize the legend? Or is it generally not possible, or what is the best way to do it? Currently, my chart legends look like this: Some legends are too wide, some are cut off, and I'd like to position the legend e.g below the chart...

Custom tooltip contents @ ngx-charts | Angular2+ | TypeScript

我只是一个虾纸丫 提交于 2019-12-06 01:38:54
问题 I've been trying to set a custom label in a line chart's tooltip , e.g., modified number of minutes in HH:mm format (74 min --> 1:14), for quite some time now, but unfortunately without any success. Displaying the value as 1.283(...3) is not an alternative. Number to HH:mm as tooltip label Does anybody know how to preserve the x and y axis values (a date and a number respectively), and modify the tooltip display value? For example: https://swimlane.github.io/ngx-charts/#/ngx-charts/line-chart

Angular ngx-charts options for customizing the Legend?

邮差的信 提交于 2019-12-05 04:16:50
I am currently using ngx-charts for Angular2, and I would like to customize some legends, e.g. place the legend below the chart, or rename the legend fields, or make the legend wider (parts of the text just gets cut off..) etc. Are there any good options to customize the legend? Or is it generally not possible, or what is the best way to do it? Currently, my chart legends look like this: Some legends are too wide, some are cut off, and I'd like to position the legend e.g below the chart... Legend Position To position the legend below the chart, you can use the legendPosition input: <ngx-charts

Custom tooltip contents @ ngx-charts | Angular2+ | TypeScript

雨燕双飞 提交于 2019-12-04 07:34:58
I've been trying to set a custom label in a line chart's tooltip , e.g., modified number of minutes in HH:mm format (74 min --> 1:14), for quite some time now, but unfortunately without any success. Displaying the value as 1.283(...3) is not an alternative. Number to HH:mm as tooltip label Does anybody know how to preserve the x and y axis values (a date and a number respectively), and modify the tooltip display value? For example: https://swimlane.github.io/ngx-charts/#/ngx-charts/line-chart Instead of having a tooltip that displays Color, Country name and Number, --> Color, Country name and