angularngx-charts

ngx-charts Step chart


Is it possible to implement a step chart using ngx-charts?

https://swimlane.gitbook.io/ngx-charts/

Step chart example

Thank you


Solution

  • Out of the box? I don't think so. Simplest way is data multiplication I guess.

    enter image description here

    export var multi = [
      {
        name: 'USA',
        series: [
          {
            name: '1990',
            value: 250000000,
          },
          {
            name: '2010',
            value: 250000000,
          },
          {
            name: '2010',
            value: 25000000,
          },
          {
            name: '2011',
            value: 25000000,
          },
          {
            name: '2011',
            value: 88000000,
          },
          {
            name: '2012',
            value: 88000000,
          },
        ],
      },
    ];
    

    Working example: https://stackblitz.com/edit/swimlane-line-chart-bl4wjq?file=app%2Fdata.ts