1

We are trying to implement a vertical bar chart using ngx-chart; currently it works with numerical values on the y-axis

<ngx-charts-bar-vertical-2d 
    [results]="ngxData.data"
    [xAxis]="showXAxis" [yAxis]="showYAxis" [legend]="true"
    [showXAxisLabel]="showXAxisLabel" [showYAxisLabel]="showYAxisLabel" 
    [legendTitle]="legendTitle">
</ngx-charts-bar-vertical-2d>

where the ngxData.data is provided as below

[
{
    "name": "X-axis 1",
    "series": [
        {
            "name": "person 1",
            "value": 100
        },
        {
            "name": "person 2",
            "value": 20
        }
    ]
},
{
    "name": "X-axis 2",
    "series": [
        {
            "name": "person 1",
            "value": 60
        },
        {
            "name": "person 2",
            "value": 40
        }
    ]
}
]

We want to replace the y-axis values with discrete brackets such as

0 < Low < 40 40 < Medium < 70 70 < High < 100

Can this be done using this library?

We tried passing the discrete values directly such as

[
{
    "name": "X-axis 1",
    "series": [
        {
            "name": "person 1",
            "value": "High"
        },
        {
            "name": "person 2",
            "value": "Low"
        }
    ]
},
{
    "name": "X-axis 2",
    "series": [
        {
            "name": "person 1",
            "value": "Medium"
        },
        {
            "name": "person 2",
            "value": "Medium"
        }
    ]
}
]

But it does not seem to work

SALIM
  • 11
  • 1

0 Answers0