已验证 提交 1559dd31 编写于 作者: xurime's avatar xurime

Support specifies that each data marker in the series has a different color

上级 a8197485
......@@ -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{},
......
......@@ -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"`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册