ngx-charts

how to initialize chart with API fetch data?

☆樱花仙子☆ 提交于 2021-02-10 07:22:55
问题 I want to use ngx-charts for my project. The problem is I don't understand how to initialize my chart with data I got from my api. The vertical bar chart seems easy. The data is of the following type: https://stackblitz.com/edit/vertical-bar-chart?embed=1&file=app/app.component.ts When I assign in the constructor Object.assign(this, data) (the data I got from my api)) I receive the following error : ERROR TypeError: Cannot read property 'toLocaleString' of undefined Their data is the

ngx-charts line chart, how to show the line chart with dot for the data point all the time

六月ゝ 毕业季﹏ 提交于 2020-08-07 21:20:05
问题 for ngx-charts line chart, it show the line chart, but there is no dot for the data point. If you hover the data point, it show a dot for the data pint and also with a label tooltip. I like to have the line chart to show all the data point with a dot all the time like this. I need your help on how to show a dot at the data point in ngx-charts line chart Here is the sample for ngx-chart https://github.com/kedmenecr/cinnamon-angular5-with-ngx-charts Here is the source code for ngx-chart libary

ngx-charts line chart, how to show the line chart with dot for the data point all the time

瘦欲@ 提交于 2020-08-07 21:07:04
问题 for ngx-charts line chart, it show the line chart, but there is no dot for the data point. If you hover the data point, it show a dot for the data pint and also with a label tooltip. I like to have the line chart to show all the data point with a dot all the time like this. I need your help on how to show a dot at the data point in ngx-charts line chart Here is the sample for ngx-chart https://github.com/kedmenecr/cinnamon-angular5-with-ngx-charts Here is the source code for ngx-chart libary

Modifying the inner CSS of ngx-charts

|▌冷眼眸甩不掉的悲伤 提交于 2020-03-23 07:59:17
问题 When I spun up the ngx-charts Advanced Pie Chart example, my legend's numbers get cut off. Digging into the CSS, this seems to be because of a margin-top being set to -6px : After experimenting in the browser, I've found that 10px makes things look as I'd like. So in the component's CSS, I added: .advanced-pie-legend.legend-items-container.legend-items.legend-item .item-value { margin-top: 10px !important; } However, this doesn't affect the CSS of the legend items at all. I've tried

NgxChartsComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: Cannot read property 'map' of undefined

霸气de小男生 提交于 2020-01-25 06:50:26
问题 This is the content of stock_inf.ts file(Actually there are bigger and different arrays, but just for summery i Put these similar arrays): export const Mellat = [1789.35, 1762.42, 1770.88, 1771.65, 1776.27, 1766.26, 1706.23]; export const Khodro= [1789.35, 1762.42, 1770.88, 1771.65, 1776.27, 1766.26, 1706.23]; export const Shepna= [1789.35, 1762.42, 1770.88, 1771.65, 1776.27, 1766.26, 1706.23]; This is a part of flow.component.ts file and these are some functions of (click) events on some

NgxChartsComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: Cannot read property 'map' of undefined

馋奶兔 提交于 2020-01-25 06:50:10
问题 This is the content of stock_inf.ts file(Actually there are bigger and different arrays, but just for summery i Put these similar arrays): export const Mellat = [1789.35, 1762.42, 1770.88, 1771.65, 1776.27, 1766.26, 1706.23]; export const Khodro= [1789.35, 1762.42, 1770.88, 1771.65, 1776.27, 1766.26, 1706.23]; export const Shepna= [1789.35, 1762.42, 1770.88, 1771.65, 1776.27, 1766.26, 1706.23]; This is a part of flow.component.ts file and these are some functions of (click) events on some

Angular 6 Ngx-charts, xAxis date sorting is wrong

别来无恙 提交于 2019-12-24 11:13:05
问题 I need to sort x-axis ticks of the chart. I tried to use [xAxisTicks], but it didn't work. I couldn't find any example related with xAxisTicks. I tried to assign a variable inside of it like: values = ["2012","2013","2014","2015","2016"]; Another interesting thing is, My series is already sorted but it still shows unsorted. Chart object (series) See chart's x-Axis 回答1: Unless you're using a time series (see https://github.com/swimlane/ngx-charts/issues/434 ), the series 'names' are just

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

我的未来我决定 提交于 2019-12-23 03:10:04
问题 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. 回答1: 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

Unable to Initialize ngx-charts with API fetched Data

匆匆过客 提交于 2019-12-13 14:36:26
问题 I'm having some bad times while trying to initialize a chart built using ngx-charts with API fetched data. I built a rest api that, upon a proper call, spits out some time-series data. { "prices": [ { "item": "1", "price": 2, "estimated": 2.1, "date": [ 2012, 8, 16 ] }, { "item": "1", "price": 3, "estimated": 4.1, "date": [ 2012, 9, 16 ] }, { "item": "1", "price": 5, "estimated": 7.1, "date": [ 2012, 10, 16 ] } ] } And I built price.model.ts to correctly handle it, and it works just fine