Bladeren bron

Merge pull request #851 from si9ma/feat_disable_axis

feat: add disable option for chart xAxis and yAxis
xuri 4 jaren geleden
bovenliggende
commit
31d88a2624
2 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  1. 3 3
      drawing.go
  2. 1 0
      xmlChart.go

+ 3 - 3
drawing.go

@@ -966,7 +966,7 @@ func (f *File) drawPlotAreaCatAx(formatSet *formatChart) []*cAxs {
 				Max:         max,
 				Min:         min,
 			},
-			Delete: &attrValBool{Val: boolPtr(false)},
+			Delete: &attrValBool{Val: boolPtr(formatSet.XAxis.None)},
 			AxPos:  &attrValString{Val: stringPtr(catAxPos[formatSet.XAxis.ReverseOrder])},
 			NumFmt: &cNumFmt{
 				FormatCode:   "General",
@@ -1020,7 +1020,7 @@ func (f *File) drawPlotAreaValAx(formatSet *formatChart) []*cAxs {
 				Max:         max,
 				Min:         min,
 			},
-			Delete: &attrValBool{Val: boolPtr(false)},
+			Delete: &attrValBool{Val: boolPtr(formatSet.YAxis.None)},
 			AxPos:  &attrValString{Val: stringPtr(valAxPos[formatSet.YAxis.ReverseOrder])},
 			NumFmt: &cNumFmt{
 				FormatCode:   chartValAxNumFmtFormatCode[formatSet.Type],
@@ -1069,7 +1069,7 @@ func (f *File) drawPlotAreaSerAx(formatSet *formatChart) []*cAxs {
 				Max:         max,
 				Min:         min,
 			},
-			Delete:     &attrValBool{Val: boolPtr(false)},
+			Delete:     &attrValBool{Val: boolPtr(formatSet.YAxis.None)},
 			AxPos:      &attrValString{Val: stringPtr(catAxPos[formatSet.XAxis.ReverseOrder])},
 			TickLblPos: &attrValString{Val: stringPtr("nextTo")},
 			SpPr:       f.drawPlotAreaSpPr(),

+ 1 - 0
xmlChart.go

@@ -520,6 +520,7 @@ type cPageMargins struct {
 
 // formatChartAxis directly maps the format settings of the chart axis.
 type formatChartAxis struct {
+	None                bool    `json:"none"`
 	Crossing            string  `json:"crossing"`
 	MajorGridlines      bool    `json:"major_grid_lines"`
 	MinorGridlines      bool    `json:"minor_grid_lines"`