Stop Negative Chart Values #1198
-
Hi I use excelize to generate a few charts and in some cases, I get a y-axis showing a negative range even though none of the graphed data contains negative values. Looking at Google I can see this is possibly an Excel "smoothing" problem. Although I can specify "minimum" value on the x-axis/y-axis this doesn't influence the generated graph. Is there a way, programmatically, I can overcome this problem Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Thanks for your feedback. Which version of the library and Excel application are you using? Could you provide generated spreadsheet file attachment without confidential info? |
Beta Was this translation helpful? Give feedback.
-
Hi Please see attached worksheet with a chart showing the negative axis |
Beta Was this translation helpful? Give feedback.
-
Thanks for your feedback. I'll fix this issue in the next released version. Next release is planned for Monday, April 11th, 2022. |
Beta Was this translation helpful? Give feedback.
-
Please upgrade to the new version 2.6.0, and specify the minimum as 0 for the Y-axis in the chart parameter like this: if err := f.AddChart("ActLog_IOSTAT_IOPS_Interval", "C35", `{
"type": "line",
"series": [
{
"name": "ActLog_IOSTAT_IOPS_Interval!$A$33",
"categories": "ActLog_IOSTAT_IOPS_Interval!$B$32$CNL$32",
"values": "ActLog_IOSTAT_IOPS_Interval!$B$33:$CNL$33",
"marker":
{
"symbol": "none"
}
}],
"title":
{
"name": "Disk Activity by Interval"
},
"format":
{
"x_scale": 2,
"y_scale": 2
},
"y_axis":
{
"minimum": 0
}
}`); err != nil {
fmt.Println(err)
return
} |
Beta Was this translation helpful? Give feedback.
Please upgrade to the new version 2.6.0, and specify the minimum as 0 for the Y-axis in the chart parameter like this: