gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
2.88k stars 633 forks source link

[BUG] #1187

Open jadzeino opened 1 year ago

jadzeino commented 1 year ago

Hi, thanks for the great library.

Issue Category

Product Versions

Observed && Desired Behaviour

the series appear in the inverse order!, there is no way to change the order of the series , the series should appear in the passed order.

Steps to Reproduce

example of the chart series


  "title": "Under 18 years old",
    "type": "bar",
    "series": [
  {
    "name": "Under 18 years old",
    "data": [
      {
        "name": "Still in school",
        "value": 0.16666666666666666,
        "color": "#2E1CBA",
        "order": 0
      },
      {
        "name": "Highschool degree",
        "value": 0.09523809523809523,
        "color": "#2E1CBA",
        "order": 1
      },
      {
        "name": "University degree",
        "value": 0.0967741935483871,
        "color": "#2E1CBA",
        "order": 2
      }
    ]
  },
  {
    "name": "Between 18 and 29 years old",
    "data": [
      {
        "name": "Still in school",
        "value": 0.05555555555555555,
        "color": "#8F85FF",
        "order": 0
      },
      {
        "name": "Highschool degree",
        "value": 0,
        "color": "#8F85FF",
        "order": 1
      },
      {
        "name": "University degree",
        "value": 0.2903225806451613,
        "color": "#8F85FF",
        "order": 2
      }
    ]
  },
  {
    "name": "Between 30 and 39 years old",
    "data": [
      {
        "name": "Still in school",
        "value": 0.2222222222222222,
        "color": "#86D7FF",
        "order": 0
      },
      {
        "name": "Highschool degree",
        "value": 0.19047619047619047,
        "color": "#86D7FF",
        "order": 1
      },
      {
        "name": "University degree",
        "value": 0.03225806451612903,
        "color": "#86D7FF",
        "order": 2
      }
    ]
  }
],
    "settings": {
  "axisMin": 0,
      "axisMax": 1,
      "axisScale": "relative",
      "showDataLabels": true
}
}```

the result do not respect the order of the series
<img width="1226" alt="image" src="https://user-images.githubusercontent.com/11145282/202129199-2b461e93-e67c-4404-a38a-d41fb5b114e9.png">
jadzeino commented 1 year ago

i managed to fix the issue by passing catAxisOrientation as maxMin within the configuration, but please be ware that the catAxisOrientation type is set to minMax as type. so u need to do this. catAxisOrientation: 'maxMin' as any;