open-xml-templating / docxtemplater

Generate docx, pptx, and xlsx from templates (Word, Powerpoint and Excel documents), from Node.js or the browser. Demo: https://www.docxtemplater.com/demo. #docx #office #generator #templating #report #json #generate #generation #template #create #pptx #docx #xlsx #react #vuejs #angularjs #browser #typescript #image #html #table #chart
https://www.docxtemplater.com
Other
3.07k stars 350 forks source link

Chart Module: Unexpected Behavior with Null Value in Data #729

Closed janWITZANY closed 1 year ago

janWITZANY commented 1 year ago

Environment

How to reproduce my problem:

I am using the Chart slide Demo with a slightly modified JSON. The error occurs when the first value of the first entry of series.data is null. The output contains the original template values, while the categories are correctly replaced with the data from the JSON.

With the following JSON data:

{
  "title": "The lorem chart",
  "chart1": {
    "categories": [
      "Europe",
      "North America",
      "Asia",
      "Africa"
    ],
    "series": [
      {
        "title": "Phone Andorra",
        "data": [
          null,
          80,
          60,
          24
        ]
      }
    ]
  }
}

I would expect:

edi9999 commented 1 year ago

Thanks for opening this issue, this is indeed a bug in the chart module, I will be fixing it soon.

janWITZANY commented 1 year ago

Thank you for your response :)

In the same example, I noticed that I would expect a different order of the categories. In a column chart(with vertical bars), the order is from left to right, while in a bar chart(with horizontal bars), the order is from bottom to top. Is this intentional behavior? Naturally, I would expect a top-down order for the bar chart.

edi9999 commented 1 year ago

I think the issue should be fixed now, in the latest demo it is working now