Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 3_triangles support #1110

Open
splier opened this issue Dec 26, 2024 · 6 comments
Open

add 3_triangles support #1110

splier opened this issue Dec 26, 2024 · 6 comments
Assignees
Labels
awaiting user feedback Waiting for users to answer a question or test a fix. feature request

Comments

@splier
Copy link

splier commented Dec 26, 2024

Feature Request

import xlsxwriter

workbook = xlsxwriter.Workbook('test.xlsx')
worksheet = workbook.add_worksheet()

data = [1, 0, -1]
worksheet.write_column('A1', data)
worksheet.conditional_format(f"A1:A3", {
'type': 'icon_set',
'icon_style': '3_triangles',
'icons': [
{'criteria': '>', 'type': 'number', 'value': 0},
{'criteria': '=', 'type': 'number', 'value': 0},
{'criteria': '<', 'type': 'number', 'value': 0},
],
})

workbook.close()

@jmcnamara
Copy link
Owner

jmcnamara commented Dec 26, 2024

What symbols are they? I don't see a 3 Triangle set in the available icons in Excel:

screenshot

@jmcnamara jmcnamara self-assigned this Dec 26, 2024
@jmcnamara jmcnamara added the awaiting user feedback Waiting for users to answer a question or test a fix. label Dec 26, 2024
@jmcnamara
Copy link
Owner

jmcnamara commented Dec 26, 2024

I'll answer my own question. You mean these ones:

screenshot

For some reason I seem to have missed them in the Python version. I'll look into it.

Note to self: also add 3 stars and 5 boxes.

@splier
Copy link
Author

splier commented Dec 27, 2024

yes, It's this one:
image
also,

# Valid icon styles.
valid_icons = {
    "3_arrows": "3Arrows",  # 1
    "3_flags": "3Flags",  # 2
    "3_traffic_lights_rimmed": "3TrafficLights2",  # 3
    "3_symbols_circled": "3Symbols",  # 4
    "4_arrows": "4Arrows",  # 5
    "4_red_to_black": "4RedToBlack",  # 6
    "4_traffic_lights": "4TrafficLights",  # 7
    "5_arrows_gray": "5ArrowsGray",  # 8
    "5_quarters": "5Quarters",  # 9
    "3_arrows_gray": "3ArrowsGray",  # 10
    "3_traffic_lights": "3TrafficLights",  # 11
    "3_signs": "3Signs",  # 12
    "3_symbols": "3Symbols2",  # 13
    "4_arrows_gray": "4ArrowsGray",  # 14
    "4_ratings": "4Rating",  # 15
    "5_arrows": "5Arrows",  # 16
    "5_ratings": "5Rating",
    "3_triangles": "3Triangles",
}  # 17

I added it '"3_triangles": "3Triangles"', but the icon displayed is wrong in excel :
image

@jmcnamara
Copy link
Owner

I added it '"3_triangles": "3Triangles"', but the icon displayed is wrong in excel :

Unfortunately, that won't work. The 3 triangles type wasn't one of the original conditional format icon sets and as such it requires additional support code and additional XML elements in the output file.

I implemented them for the Rust version so it should be a straightforward addition.

@splier
Copy link
Author

splier commented Dec 30, 2024

Could you please inform me of the timeline for adding this support?

@jmcnamara
Copy link
Owner

Could you please inform me of the timeline for adding this support?

No. Support timelines aren't usually a part of open-source software. It is a nontrivial change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting user feedback Waiting for users to answer a question or test a fix. feature request
Projects
None yet
Development

No branches or pull requests

2 participants