jmcnamara / libxlsxwriter

A C library for creating Excel XLSX files.
https://libxlsxwriter.github.io
Other
1.49k stars 332 forks source link

There is no function to change axis type: Automatic, Text, Date #376

Closed aa4re closed 2 years ago

aa4re commented 2 years ago

Hello, In the third image that appears in this tutorial https://libxlsxwriter.github.io/working_with_charts.html The axis type configuration setting appears in the displayed window: Horizontal axis type : automatic, Text, Date What I want to know is how to programmatically set the axis type to Text instead of Automatic using the libxlsxwriter library I have the problem shown on this page: https://es.extendoffice.com/documents/excel/3242-excel-show-milliseconds.html Thank you very much

aa4re commented 2 years ago

imagen

jmcnamara commented 2 years ago

That isn't currently supported in the C version. It is supported in the Python version:

https://xlsxwriter.readthedocs.io/chart.html?highlight=text_axis#chart-set-x-axis

I could look at adding it to the C version however it is a feature that is rarely used in practice and I don't know if it will actually fix any real world problem that you have. In addition it is easily replicated with the existing APIs by setting a text format on the data the chart is graphed from.

But let's take a step back. What is the issue that you are having. the doc you linked to talks about setting millisecond precision. Is that what you are trying to do?

aa4re commented 2 years ago

Thank you very much for your reply, I have made a mistake when putting the link of the problem that I have, the correct link is: https://www.extendoffice.com/documents/excel/4203-excel-chart-with-date-and-time-on-x-axis.html

The library generates this graph, where the X axis type is set to automatic.

imagen

The correct graph that I want to show is the following, the only thing that changes is that now I have manually changed the type of the x-axis to Text.

imagen

It is very important to be able to change the type of axis since anyone who works with time data will encounter this problem. it's possible?

jmcnamara commented 2 years ago

Ok. Could you add a small working example (to avoid confusion) and I will look at adding the feature.

jmcnamara commented 2 years ago

Just a reminder that without a small working example I cannot evaluate this issue and will close it after a week.

jmcnamara commented 2 years ago

Closing due to lack of response.