简体   繁体   中英

Change axis format of a chart in openpyxl?

I'm working with an Excel line chart by using the library openpyxl. I would like to know how to format the axis, so I can modify it from text format to date format.

Thanks in advance!

datetime.strptime() might be of value in this instance to parse a string to a date format. openpyxl's .number_format might also be a solution based on which worksheet cell it is reading from.


References:

strptime() : https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior

number_format() : https://openpyxl.readthedocs.io/en/stable/usage.html#using-number-formats

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM