From 42b1c8148883844cf80b70a3096e6ee67be01f61 Mon Sep 17 00:00:00 2001 From: "Huy Bui (Kevin)" <2992996+huybuidev@users.noreply.github.com> Date: Sat, 11 Jul 2020 01:07:41 +0800 Subject: Resolve #661 Add Logarithmic scale option support on Y axis (#662) * Resolve #661 Add Logarithmic scale option support on Y axis Example usage: Add the following option into the format string when using AddChart: "y_axis":{"scaling":{"logbase":"10"}} * Change type of LogBase from attrValString to attrVarFloat * Add test case for testing Logarithmic Option in Y axis of charts * Move field `LogBase` in the format string up one level (remove `Scaling`) as suggested the owner Test cases are updated accordingly. --- xmlChart.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xmlChart.go') diff --git a/xmlChart.go b/xmlChart.go index 6f800d7..fae5426 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -380,6 +380,7 @@ type cChartLines struct { // cScaling directly maps the scaling element. This element contains // additional axis settings. type cScaling struct { + LogBase *attrValFloat `xml:"logBase"` Orientation *attrValString `xml:"orientation"` Max *attrValFloat `xml:"max"` Min *attrValFloat `xml:"min"` @@ -544,6 +545,7 @@ type formatChartAxis struct { Italic bool `json:"italic"` Underline bool `json:"underline"` } `json:"num_font"` + LogBase float64 `json:"logbase"` NameLayout formatLayout `json:"name_layout"` } -- cgit v1.2.1