From 6abf8bf9723512086f009ca574bde1d6682fc83d Mon Sep 17 00:00:00 2001 From: xuri Date: Sun, 27 Oct 2019 14:16:02 +0800 Subject: Resolve #501, support set minor grid lines for the chart --- chart.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'chart.go') diff --git a/chart.go b/chart.go index 289903e..bbd71d6 100644 --- a/chart.go +++ b/chart.go @@ -652,10 +652,16 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) { // // Set the primary horizontal and vertical axis options by x_axis and y_axis. The properties that can be set are: // +// major_grid_lines +// minor_grid_lines // reverse_order // maximum // minimum // +// major_grid_lines: Specifies major gridlines. +// +// minor_grid_lines: Specifies minor gridlines. +// // reverse_order: Specifies that the categories or values on reverse order (orientation of the chart). The reverse_order property is optional. The default value is false. // // maximum: Specifies that the fixed maximum, 0 is auto. The maximum property is optional. The default value is auto. @@ -1601,6 +1607,9 @@ func (f *File) drawPlotAreaCatAx(formatSet *formatChart) []*cAxs { if formatSet.XAxis.MajorGridlines { axs[0].MajorGridlines = &cChartLines{SpPr: f.drawPlotAreaSpPr()} } + if formatSet.XAxis.MinorGridlines { + axs[0].MinorGridlines = &cChartLines{SpPr: f.drawPlotAreaSpPr()} + } return axs } @@ -1641,6 +1650,9 @@ func (f *File) drawPlotAreaValAx(formatSet *formatChart) []*cAxs { if formatSet.YAxis.MajorGridlines { axs[0].MajorGridlines = &cChartLines{SpPr: f.drawPlotAreaSpPr()} } + if formatSet.YAxis.MinorGridlines { + axs[0].MinorGridlines = &cChartLines{SpPr: f.drawPlotAreaSpPr()} + } if pos, ok := valTickLblPos[formatSet.Type]; ok { axs[0].TickLblPos.Val = pos } -- cgit v1.2.1