diff options
-rw-r--r-- | chart.go | 3 | ||||
-rw-r--r-- | drawing.go | 12 | ||||
-rw-r--r-- | xmlChart.go | 19 |
3 files changed, 19 insertions, 15 deletions
@@ -494,6 +494,7 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) { Title: formatChartTitle{ Name: " ", }, + VaryColors: true, ShowBlanksAs: "gap", } err := json.Unmarshal([]byte(formatSet), &format) @@ -711,6 +712,8 @@ func parseFormatChartSet(formatSet string) (*formatChart, error) { // // zero: Specifies that blank values shall be treated as zero. // +// Specifies that each data marker in the series has a different color by vary_colors. The default value is true. +// // Set chart offset, scale, aspect ratio setting and print settings by format, same as function AddPicture. // // Set the position of the chart plot area by plotarea. The properties that can be set are: @@ -271,7 +271,7 @@ func (f *File) drawBaseChart(formatSet *formatChart) *cPlotArea { Val: stringPtr("clustered"), }, VaryColors: &attrValBool{ - Val: boolPtr(true), + Val: boolPtr(formatSet.VaryColors), }, Ser: f.drawChartSeries(formatSet), Shape: f.drawChartShape(formatSet), @@ -515,7 +515,7 @@ func (f *File) drawDoughnutChart(formatSet *formatChart) *cPlotArea { return &cPlotArea{ DoughnutChart: &cCharts{ VaryColors: &attrValBool{ - Val: boolPtr(true), + Val: boolPtr(formatSet.VaryColors), }, Ser: f.drawChartSeries(formatSet), HoleSize: &attrValInt{Val: intPtr(75)}, @@ -555,7 +555,7 @@ func (f *File) drawPieChart(formatSet *formatChart) *cPlotArea { return &cPlotArea{ PieChart: &cCharts{ VaryColors: &attrValBool{ - Val: boolPtr(true), + Val: boolPtr(formatSet.VaryColors), }, Ser: f.drawChartSeries(formatSet), }, @@ -568,7 +568,7 @@ func (f *File) drawPie3DChart(formatSet *formatChart) *cPlotArea { return &cPlotArea{ Pie3DChart: &cCharts{ VaryColors: &attrValBool{ - Val: boolPtr(true), + Val: boolPtr(formatSet.VaryColors), }, Ser: f.drawChartSeries(formatSet), }, @@ -584,7 +584,7 @@ func (f *File) drawPieOfPieChart(formatSet *formatChart) *cPlotArea { Val: stringPtr("pie"), }, VaryColors: &attrValBool{ - Val: boolPtr(true), + Val: boolPtr(formatSet.VaryColors), }, Ser: f.drawChartSeries(formatSet), SerLines: &attrValString{}, @@ -601,7 +601,7 @@ func (f *File) drawBarOfPieChart(formatSet *formatChart) *cPlotArea { Val: stringPtr("bar"), }, VaryColors: &attrValBool{ - Val: boolPtr(true), + Val: boolPtr(formatSet.VaryColors), }, Ser: f.drawChartSeries(formatSet), SerLines: &attrValString{}, diff --git a/xmlChart.go b/xmlChart.go index 637d954..85a2c5c 100644 --- a/xmlChart.go +++ b/xmlChart.go @@ -553,15 +553,16 @@ type formatChartDimension struct { // formatChart directly maps the format settings of the chart. type formatChart struct { - Type string `json:"type"` - Series []formatChartSeries `json:"series"` - Format formatPicture `json:"format"` - Dimension formatChartDimension `json:"dimension"` - Legend formatChartLegend `json:"legend"` - Title formatChartTitle `json:"title"` - XAxis formatChartAxis `json:"x_axis"` - YAxis formatChartAxis `json:"y_axis"` - Chartarea struct { + Type string `json:"type"` + Series []formatChartSeries `json:"series"` + Format formatPicture `json:"format"` + Dimension formatChartDimension `json:"dimension"` + Legend formatChartLegend `json:"legend"` + Title formatChartTitle `json:"title"` + VaryColors bool `json:"vary_colors"` + XAxis formatChartAxis `json:"x_axis"` + YAxis formatChartAxis `json:"y_axis"` + Chartarea struct { Border struct { None bool `json:"none"` } `json:"border"` |