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

Creating data bars MinValue and/or MaxValue not set correctly in EXCEL #1492

Closed
usuallyvexed opened this issue Mar 13, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@usuallyvexed
Copy link

Description

I am trying to use the conditional formatting feature and create some data bars, this partially works.
However, whenever I try to specify min and or max values, excelize does not appear to be converting the numeric values correctly.

Steps to reproduce the issue:

  1. Create a column if increasing numbers, 1-100.
  2. Use the following code to conditionally format the cells:
    err = ss.Excelize.SetConditionalFormat(sheetName, fmt.Sprintf("$AL$%d:$AL$%d", startRow, nodeRow-1),
    []excelize.ConditionalFormatOptions{
    {
    Type: "data_bar",
    Criteria: "=",
    MinType: "num",
    MinValue: "0",
    MaxType: "num",
    MaxValue: "100",
    BarColor: "#FF0000,
    },
    },
    )
  3. Go into EXCEL, select the range and then the HOME tab, Conditional Formatting, Manage Rules, then edit rule.

Describe the results you received:

For me the max value shows up as zero.

Describe the results you expected:

I was expecting the max value to be 100.

If I tried using a cell reference, the formatting of the cell reference in EXCEL was wrong as well, it would contain extraneous quotation marks(").

Output of go version:
go version go1.20.2 windows/amd64

(paste your output here)

Excelize version or commit ID:

github.com/xuri/excelize/v2 v2.7.0 // indirect

Environment details (OS, Microsoft Excel™ version, physical, etc.):

Windows 10
EXCEL 2013 part of the Microsoft Office 2013 bundle

databar-issue-reported-20230313

@xuri xuri closed this as completed in 0d193c7 Mar 13, 2023
@xuri
Copy link
Member

xuri commented Mar 13, 2023

Thanks for your issue. I have fixed it, please upgrade to the master branch code, and this patch will be released in the next version.

@xuri xuri added the bug Something isn't working label Mar 13, 2023
fudali113 pushed a commit to fudali113/excelize that referenced this issue Apr 17, 2023
xuri added a commit to JDavidVR/excelize that referenced this issue Jul 11, 2023
jenbonzhang pushed a commit to jenbonzhang/excelize that referenced this issue Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants