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

min/mid/max_value not used for 2 and 3 color scale conditional formatting #252

Closed
alex-whitney opened this issue Jul 25, 2018 · 0 comments · Fixed by #253
Closed

min/mid/max_value not used for 2 and 3 color scale conditional formatting #252

alex-whitney opened this issue Jul 25, 2018 · 0 comments · Fixed by #253

Comments

@alex-whitney
Copy link
Contributor

Description

For conditional formatting utilizing 2_color_scale or 3_color_scale formatting types, min_value, max_value, and mid_value are not used as documented.

Steps to reproduce the issue:

package main

import (
	"github.com/360EntSecGroup-Skylar/excelize"
)

func main() {
	xlsx := excelize.NewFile()
	sheet := "sheet1"

	format := `[{
		"type":"3_color_scale",
		"criteria":"=",
		"min_type":"num",
		"mid_type":"num",
		"max_type":"num",
		"min_value": "-10",
		"mid_value": "0",
		"max_value": "10",
		"min_color":"ff0000",
		"mid_color":"00ff00",
		"max_color":"0000ff"
	  }]`
	xlsx.SetConditionalFormat(sheet, "A1:A1", format)
	xlsx.SetCellValue(sheet, "A1", -5)
	xlsx.SaveAs("format.xlsx")
}

Describe the results you received:
image

Describe the results you expected:
image

Go version

$ go version
go version go1.10.3 windows/amd64

Excelize version or commit ID:

v1.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant