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

How to set chart labels font color #320

Closed
vasiliyaltunin opened this issue Dec 27, 2018 · 9 comments
Closed

How to set chart labels font color #320

vasiliyaltunin opened this issue Dec 27, 2018 · 9 comments
Labels
enhancement New feature or request
Projects

Comments

@vasiliyaltunin
Copy link

I creating horisontal bar chart, but font color for legends is light gray and hard to read, i use Excel 2016
shot1

@devinyonas
Copy link

devinyonas commented Mar 6, 2020

Any update on this issue? or is there any workaround to edit the axis font color?

@xuri
Copy link
Member

xuri commented Mar 6, 2020

Hi @vasiliyaltunin, @davey06. Please adjust the value of lumOff temporary, I'll add support for specifying luminance shifted with custom lumOff later.

@devinyonas
Copy link

@xuri thanks for the fast response!

Screen Shot 2020-03-06 at 15 43 33

grefab pushed a commit to IsotronicGmbH/excelize that referenced this issue May 17, 2021
@jholder85638
Copy link

Hi @davey06 could you share how you got the text to be black? I've tried setting the values but the text is always grey. I also checked out the revision with the above commit, same problem.

@tetsuyanh
Copy link

@xuri
Thanks for your great work. I use this library.
I cannot fix this issue by IsotronicGmbH@00509e5.
I'm looking forward to solve this.

@xuri
Copy link
Member

xuri commented Jul 13, 2022

Hi @tetsuyanh, thanks for your feedback, which version of Excelize you're using? If you're using the v2.6.0 and later, please adjust the value of lumOff to 0 like this:

LumOff: &attrValInt{Val: intPtr(0)},

@tetsuyanh
Copy link

@xuri Thanks! It works!
I use this adjustment by fork for a while.

@xuri xuri added the in progress Working in progress label Oct 13, 2022
@xuri xuri closed this as completed in 3d02726 Oct 13, 2022
@xuri xuri added this to Feature in v2.7.0 Oct 13, 2022
@xuri xuri removed the in progress Working in progress label Oct 13, 2022
@xuri
Copy link
Member

xuri commented Oct 14, 2022

Hi @tetsuyanh, I have added support for set chart labels font style, please upgrade to the master branch code if you need it, and this feature will be released in the next version. Now you can set font RGB color in font field like this:

&excelize.Chart{
    Type: excelize.Col3DClustered,
    Series: []excelize.ChartSeries{
        {
            Name:       "Sheet1!$A$2",
            Categories: "Sheet1!$B$1:$D$1",
            Values:     "Sheet1!$B$2:$D$2",
        }, {
            Name:       "Sheet1!$A$3",
            Categories: "Sheet1!$B$1:$D$1",
            Values:     "Sheet1!$B$3:$D$3",
        }, {
            Name:       "Sheet1!$A$4",
            Categories: "Sheet1!$B$1:$D$1",
            Values:     "Sheet1!$B$4:$D$4",
        },
    },
    Title: excelize.ChartTitle{
        Name: "Fruit 3D Clustered Column Chart",
    },
    XAxis: excelize.ChartAxis{
+        Font: excelize.Font{
+            Bold:      true,
+            Italic:    true,
+            Underline: "dbl",
+            Color:     "#000000",
+        },
    },
    YAxis: excelize.ChartAxis{
+        Font: excelize.Font{
+            Bold:      false,
+            Italic:    false,
+            Underline: "sng",
+            Color:     "#777777",
+        },
    },
}

@tetsuyanh
Copy link

@xuri Thanks, so so much!

This was referenced Jul 4, 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
enhancement New feature or request
Projects
No open projects
v2.7.0
Feature
Development

No branches or pull requests

5 participants