[GH-ISSUE #376] There is no function to change axis type: Automatic, Text, Date #301

Closed
opened 2026-05-05 12:07:29 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @aa4re on GitHub (Aug 9, 2022).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/376

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

Originally created by @aa4re on GitHub (Aug 9, 2022). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/376 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
Author
Owner

@aa4re commented on GitHub (Aug 10, 2022):

imagen

<!-- gh-comment-id:1210254478 --> @aa4re commented on GitHub (Aug 10, 2022): ![imagen](https://user-images.githubusercontent.com/18484541/183837451-e0913b2d-7654-40ca-9fe6-5bdbdeaa994e.png)
Author
Owner

@jmcnamara commented on GitHub (Aug 10, 2022):

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?

<!-- gh-comment-id:1210352283 --> @jmcnamara commented on GitHub (Aug 10, 2022): 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?
Author
Owner

@aa4re commented on GitHub (Aug 10, 2022):

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?

<!-- gh-comment-id:1210516584 --> @aa4re commented on GitHub (Aug 10, 2022): 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](https://user-images.githubusercontent.com/18484541/183885674-b64a51aa-2849-475c-8764-75cd5708a85e.png) 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](https://user-images.githubusercontent.com/18484541/183885772-a6c745ec-4cfd-4c90-939e-6ee798e8105f.png) 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?
Author
Owner

@jmcnamara commented on GitHub (Aug 10, 2022):

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

<!-- gh-comment-id:1210610720 --> @jmcnamara commented on GitHub (Aug 10, 2022): Ok. Could you add a small working example (to avoid confusion) and I will look at adding the feature.
Author
Owner

@jmcnamara commented on GitHub (Aug 13, 2022):

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

<!-- gh-comment-id:1213613312 --> @jmcnamara commented on GitHub (Aug 13, 2022): Just a reminder that without a small working example I cannot evaluate this issue and will close it after a week.
Author
Owner

@jmcnamara commented on GitHub (Aug 25, 2022):

Closing due to lack of response.

<!-- gh-comment-id:1227817885 --> @jmcnamara commented on GitHub (Aug 25, 2022): Closing due to lack of response.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#301
No description provided.