【发布时间】:2022-12-27 22:31:05
【问题描述】:
I'm implementing an amChartsv5 gantt chart on Angular 13, where each bar(category) would be a project and if there are two or more occurrences of a category, they should stack, like a timeline. Managed to get it from a local JSON and to add some custom properties, the only problem is: the chart creates one line for each declaration, even when the categories matches.
OBS: the bar stacks perfectly, all the inputs in sequence as intended but the chart creates 3 lines and two of then are empty, only the third is populated by the data as it should be.
JSON example:
[
{
"category": "LETICIA",
"fromDate": "2022-08-02 00:00",
"toDate": "2022-08-08 23:59",
"columnSettings": {
"fill": "#57315b"
},
"task": "Sprint #1",
"personnel": 13
},
{
"category": "LETICIA",
"fromDate": "2022-08-08 00:00",
"toDate": "2022-08-09 23:59",
"columnSettings": {
"fill": "#E6E6FA"
},
"task": "Presentation",
"personnel": 14
},
{
"category": "LETICIA",
"fromDate": "2022-08-09 00:00",
"toDate": "2022-08-19 23:59",
"columnSettings": {
"fill": "#57315b"
},
"task": "Sprint #1",
"personnel": 15
}
]
tried to manipulate the JSON but so far no success Is there a way to get rid of those unecessary category creations?
didnt manage to adapt it for the stackblitz but here is how my component and service are right now: https://stackblitz.com/edit/angular-ivy-hpeih1?file=src/app/app.component.ts
【问题讨论】:
标签: angular typescript amcharts gantt-chart stacked-chart