This closes #1983, support create combo chart with same types
- Add new exported ChartLineUnset enumeration - Fix set line type of line chart does not work - Support set line type of scatter chart
This commit is contained in:
parent
aca04ecf57
commit
8c0ef7f90d
3
chart.go
3
chart.go
|
@ -85,7 +85,8 @@ type ChartLineType byte
|
|||
|
||||
// This section defines the currently supported chart line types enumeration.
|
||||
const (
|
||||
ChartLineSolid ChartLineType = iota
|
||||
ChartLineUnset ChartLineType = iota
|
||||
ChartLineSolid
|
||||
ChartLineNone
|
||||
ChartLineAutomatic
|
||||
)
|
||||
|
|
173
drawing.go
173
drawing.go
|
@ -176,7 +176,12 @@ func (f *File) addChart(opts *Chart, comboCharts []*Chart) {
|
|||
if field.IsNil() {
|
||||
continue
|
||||
}
|
||||
immutable.FieldByName(mutable.Type().Field(i).Name).Set(field)
|
||||
fld := immutable.FieldByName(mutable.Type().Field(i).Name)
|
||||
if field.Kind() == reflect.Slice && i < 16 { // All []*cCharts type fields
|
||||
fld.Set(reflect.Append(fld, field.Index(0)))
|
||||
continue
|
||||
}
|
||||
fld.Set(field)
|
||||
}
|
||||
}
|
||||
addChart(xlsxChartSpace.Chart.PlotArea, plotAreaFunc[opts.Type](xlsxChartSpace.Chart.PlotArea, opts))
|
||||
|
@ -194,7 +199,8 @@ func (f *File) addChart(opts *Chart, comboCharts []*Chart) {
|
|||
// drawBaseChart provides a function to draw the c:plotArea element for bar,
|
||||
// and column series charts by given format sets.
|
||||
func (f *File) drawBaseChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
c := cCharts{
|
||||
c := []*cCharts{
|
||||
{
|
||||
BarDir: &attrValString{
|
||||
Val: stringPtr("col"),
|
||||
},
|
||||
|
@ -209,224 +215,225 @@ func (f *File) drawBaseChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
DLbls: f.drawChartDLbls(opts),
|
||||
AxID: f.genAxID(opts),
|
||||
Overlap: &attrValInt{Val: intPtr(100)},
|
||||
},
|
||||
}
|
||||
var ok bool
|
||||
if *c.BarDir.Val, ok = plotAreaChartBarDir[opts.Type]; !ok {
|
||||
c.BarDir = nil
|
||||
if *c[0].BarDir.Val, ok = plotAreaChartBarDir[opts.Type]; !ok {
|
||||
c[0].BarDir = nil
|
||||
}
|
||||
if *c.Overlap.Val, ok = plotAreaChartOverlap[opts.Type]; !ok {
|
||||
c.Overlap = nil
|
||||
if *c[0].Overlap.Val, ok = plotAreaChartOverlap[opts.Type]; !ok {
|
||||
c[0].Overlap = nil
|
||||
}
|
||||
catAx := f.drawPlotAreaCatAx(pa, opts)
|
||||
valAx := f.drawPlotAreaValAx(pa, opts)
|
||||
charts := map[ChartType]*cPlotArea{
|
||||
Area: {
|
||||
AreaChart: &c,
|
||||
AreaChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
AreaStacked: {
|
||||
AreaChart: &c,
|
||||
AreaChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
AreaPercentStacked: {
|
||||
AreaChart: &c,
|
||||
AreaChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Area3D: {
|
||||
Area3DChart: &c,
|
||||
Area3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Area3DStacked: {
|
||||
Area3DChart: &c,
|
||||
Area3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Area3DPercentStacked: {
|
||||
Area3DChart: &c,
|
||||
Area3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar: {
|
||||
BarChart: &c,
|
||||
BarChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
BarStacked: {
|
||||
BarChart: &c,
|
||||
BarChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
BarPercentStacked: {
|
||||
BarChart: &c,
|
||||
BarChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DClustered: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DPercentStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DConeClustered: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DConeStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DConePercentStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DPyramidClustered: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DPyramidStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DPyramidPercentStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DCylinderClustered: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DCylinderStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bar3DCylinderPercentStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col: {
|
||||
BarChart: &c,
|
||||
BarChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
ColStacked: {
|
||||
BarChart: &c,
|
||||
BarChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
ColPercentStacked: {
|
||||
BarChart: &c,
|
||||
BarChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3D: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DClustered: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DPercentStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DCone: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DConeClustered: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DConeStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DConePercentStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DPyramid: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DPyramidClustered: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DPyramidStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DPyramidPercentStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DCylinder: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DCylinderClustered: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DCylinderStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Col3DCylinderPercentStacked: {
|
||||
Bar3DChart: &c,
|
||||
Bar3DChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bubble: {
|
||||
BubbleChart: &c,
|
||||
BubbleChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
Bubble3D: {
|
||||
BubbleChart: &c,
|
||||
BubbleChart: c,
|
||||
CatAx: catAx,
|
||||
ValAx: valAx,
|
||||
},
|
||||
|
@ -443,13 +450,15 @@ func (f *File) drawDoughnutChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
}
|
||||
|
||||
return &cPlotArea{
|
||||
DoughnutChart: &cCharts{
|
||||
DoughnutChart: []*cCharts{
|
||||
{
|
||||
VaryColors: &attrValBool{
|
||||
Val: opts.VaryColors,
|
||||
},
|
||||
Ser: f.drawChartSeries(opts),
|
||||
HoleSize: &attrValInt{Val: intPtr(holeSize)},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -457,7 +466,8 @@ func (f *File) drawDoughnutChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// chart by given format sets.
|
||||
func (f *File) drawLineChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
return &cPlotArea{
|
||||
LineChart: &cCharts{
|
||||
LineChart: []*cCharts{
|
||||
{
|
||||
Grouping: &attrValString{
|
||||
Val: stringPtr(plotAreaChartGrouping[opts.Type]),
|
||||
},
|
||||
|
@ -468,6 +478,7 @@ func (f *File) drawLineChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
DLbls: f.drawChartDLbls(opts),
|
||||
AxID: f.genAxID(opts),
|
||||
},
|
||||
},
|
||||
CatAx: f.drawPlotAreaCatAx(pa, opts),
|
||||
ValAx: f.drawPlotAreaValAx(pa, opts),
|
||||
}
|
||||
|
@ -477,7 +488,8 @@ func (f *File) drawLineChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// chart by given format sets.
|
||||
func (f *File) drawLine3DChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
return &cPlotArea{
|
||||
Line3DChart: &cCharts{
|
||||
Line3DChart: []*cCharts{
|
||||
{
|
||||
Grouping: &attrValString{
|
||||
Val: stringPtr(plotAreaChartGrouping[opts.Type]),
|
||||
},
|
||||
|
@ -488,6 +500,7 @@ func (f *File) drawLine3DChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
DLbls: f.drawChartDLbls(opts),
|
||||
AxID: f.genAxID(opts),
|
||||
},
|
||||
},
|
||||
CatAx: f.drawPlotAreaCatAx(pa, opts),
|
||||
ValAx: f.drawPlotAreaValAx(pa, opts),
|
||||
}
|
||||
|
@ -497,12 +510,14 @@ func (f *File) drawLine3DChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// chart by given format sets.
|
||||
func (f *File) drawPieChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
return &cPlotArea{
|
||||
PieChart: &cCharts{
|
||||
PieChart: []*cCharts{
|
||||
{
|
||||
VaryColors: &attrValBool{
|
||||
Val: opts.VaryColors,
|
||||
},
|
||||
Ser: f.drawChartSeries(opts),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -510,12 +525,14 @@ func (f *File) drawPieChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// pie chart by given format sets.
|
||||
func (f *File) drawPie3DChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
return &cPlotArea{
|
||||
Pie3DChart: &cCharts{
|
||||
Pie3DChart: []*cCharts{
|
||||
{
|
||||
VaryColors: &attrValBool{
|
||||
Val: opts.VaryColors,
|
||||
},
|
||||
Ser: f.drawChartSeries(opts),
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -527,7 +544,8 @@ func (f *File) drawPieOfPieChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
splitPos = &attrValInt{Val: intPtr(opts.PlotArea.SecondPlotValues)}
|
||||
}
|
||||
return &cPlotArea{
|
||||
OfPieChart: &cCharts{
|
||||
OfPieChart: []*cCharts{
|
||||
{
|
||||
OfPieType: &attrValString{
|
||||
Val: stringPtr("pie"),
|
||||
},
|
||||
|
@ -538,6 +556,7 @@ func (f *File) drawPieOfPieChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
SplitPos: splitPos,
|
||||
SerLines: &attrValString{},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -549,7 +568,8 @@ func (f *File) drawBarOfPieChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
splitPos = &attrValInt{Val: intPtr(opts.PlotArea.SecondPlotValues)}
|
||||
}
|
||||
return &cPlotArea{
|
||||
OfPieChart: &cCharts{
|
||||
OfPieChart: []*cCharts{
|
||||
{
|
||||
OfPieType: &attrValString{
|
||||
Val: stringPtr("bar"),
|
||||
},
|
||||
|
@ -560,6 +580,7 @@ func (f *File) drawBarOfPieChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
Ser: f.drawChartSeries(opts),
|
||||
SerLines: &attrValString{},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -567,7 +588,8 @@ func (f *File) drawBarOfPieChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// chart by given format sets.
|
||||
func (f *File) drawRadarChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
return &cPlotArea{
|
||||
RadarChart: &cCharts{
|
||||
RadarChart: []*cCharts{
|
||||
{
|
||||
RadarStyle: &attrValString{
|
||||
Val: stringPtr("marker"),
|
||||
},
|
||||
|
@ -578,6 +600,7 @@ func (f *File) drawRadarChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
DLbls: f.drawChartDLbls(opts),
|
||||
AxID: f.genAxID(opts),
|
||||
},
|
||||
},
|
||||
CatAx: f.drawPlotAreaCatAx(pa, opts),
|
||||
ValAx: f.drawPlotAreaValAx(pa, opts),
|
||||
}
|
||||
|
@ -587,7 +610,8 @@ func (f *File) drawRadarChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// scatter chart by given format sets.
|
||||
func (f *File) drawScatterChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
return &cPlotArea{
|
||||
ScatterChart: &cCharts{
|
||||
ScatterChart: []*cCharts{
|
||||
{
|
||||
ScatterStyle: &attrValString{
|
||||
Val: stringPtr("smoothMarker"), // line,lineMarker,marker,none,smooth,smoothMarker
|
||||
},
|
||||
|
@ -598,6 +622,7 @@ func (f *File) drawScatterChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
DLbls: f.drawChartDLbls(opts),
|
||||
AxID: f.genAxID(opts),
|
||||
},
|
||||
},
|
||||
ValAx: append(f.drawPlotAreaCatAx(pa, opts), f.drawPlotAreaValAx(pa, opts)...),
|
||||
}
|
||||
}
|
||||
|
@ -606,7 +631,8 @@ func (f *File) drawScatterChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// given format sets.
|
||||
func (f *File) drawSurface3DChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
plotArea := &cPlotArea{
|
||||
Surface3DChart: &cCharts{
|
||||
Surface3DChart: []*cCharts{
|
||||
{
|
||||
Ser: f.drawChartSeries(opts),
|
||||
AxID: []*attrValInt{
|
||||
{Val: intPtr(100000000)},
|
||||
|
@ -614,12 +640,13 @@ func (f *File) drawSurface3DChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
{Val: intPtr(100000005)},
|
||||
},
|
||||
},
|
||||
},
|
||||
CatAx: f.drawPlotAreaCatAx(pa, opts),
|
||||
ValAx: f.drawPlotAreaValAx(pa, opts),
|
||||
SerAx: f.drawPlotAreaSerAx(opts),
|
||||
}
|
||||
if opts.Type == WireframeSurface3D {
|
||||
plotArea.Surface3DChart.Wireframe = &attrValBool{Val: boolPtr(true)}
|
||||
plotArea.Surface3DChart[0].Wireframe = &attrValBool{Val: boolPtr(true)}
|
||||
}
|
||||
return plotArea
|
||||
}
|
||||
|
@ -628,7 +655,8 @@ func (f *File) drawSurface3DChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// given format sets.
|
||||
func (f *File) drawSurfaceChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
plotArea := &cPlotArea{
|
||||
SurfaceChart: &cCharts{
|
||||
SurfaceChart: []*cCharts{
|
||||
{
|
||||
Ser: f.drawChartSeries(opts),
|
||||
AxID: []*attrValInt{
|
||||
{Val: intPtr(100000000)},
|
||||
|
@ -636,12 +664,13 @@ func (f *File) drawSurfaceChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
{Val: intPtr(100000005)},
|
||||
},
|
||||
},
|
||||
},
|
||||
CatAx: f.drawPlotAreaCatAx(pa, opts),
|
||||
ValAx: f.drawPlotAreaValAx(pa, opts),
|
||||
SerAx: f.drawPlotAreaSerAx(opts),
|
||||
}
|
||||
if opts.Type == WireframeContour {
|
||||
plotArea.SurfaceChart.Wireframe = &attrValBool{Val: boolPtr(true)}
|
||||
plotArea.SurfaceChart[0].Wireframe = &attrValBool{Val: boolPtr(true)}
|
||||
}
|
||||
return plotArea
|
||||
}
|
||||
|
@ -650,7 +679,8 @@ func (f *File) drawSurfaceChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
// given format sets.
|
||||
func (f *File) drawBubbleChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
||||
plotArea := &cPlotArea{
|
||||
BubbleChart: &cCharts{
|
||||
BubbleChart: []*cCharts{
|
||||
{
|
||||
VaryColors: &attrValBool{
|
||||
Val: opts.VaryColors,
|
||||
},
|
||||
|
@ -658,10 +688,11 @@ func (f *File) drawBubbleChart(pa *cPlotArea, opts *Chart) *cPlotArea {
|
|||
DLbls: f.drawChartDLbls(opts),
|
||||
AxID: f.genAxID(opts),
|
||||
},
|
||||
},
|
||||
ValAx: append(f.drawPlotAreaCatAx(pa, opts), f.drawPlotAreaValAx(pa, opts)...),
|
||||
}
|
||||
if opts.BubbleSize > 0 && opts.BubbleSize <= 300 {
|
||||
plotArea.BubbleChart.BubbleScale = &attrValFloat{Val: float64Ptr(float64(opts.BubbleSize))}
|
||||
plotArea.BubbleChart[0].BubbleScale = &attrValFloat{Val: float64Ptr(float64(opts.BubbleSize))}
|
||||
}
|
||||
return plotArea
|
||||
}
|
||||
|
@ -750,23 +781,19 @@ func (f *File) drawShapeFill(fill Fill, spPr *cSpPr) *cSpPr {
|
|||
func (f *File) drawChartSeriesSpPr(i int, opts *Chart) *cSpPr {
|
||||
spPr := &cSpPr{SolidFill: &aSolidFill{SchemeClr: &aSchemeClr{Val: "accent" + strconv.Itoa((opts.order+i)%6+1)}}}
|
||||
spPr = f.drawShapeFill(opts.Series[i].Fill, spPr)
|
||||
spPrScatter := &cSpPr{
|
||||
Ln: &aLn{
|
||||
W: 25400,
|
||||
NoFill: &attrValString{},
|
||||
},
|
||||
}
|
||||
spPrLine := &cSpPr{
|
||||
solid := &cSpPr{
|
||||
Ln: &aLn{
|
||||
W: f.ptToEMUs(opts.Series[i].Line.Width),
|
||||
Cap: "rnd", // rnd, sq, flat
|
||||
SolidFill: spPr.SolidFill,
|
||||
},
|
||||
}
|
||||
if chartSeriesSpPr, ok := map[ChartType]*cSpPr{
|
||||
Line: spPrLine, Scatter: spPrScatter,
|
||||
noLn := &cSpPr{Ln: &aLn{NoFill: &attrValString{}}}
|
||||
if chartSeriesSpPr, ok := map[ChartType]map[ChartLineType]*cSpPr{
|
||||
Line: {ChartLineUnset: solid, ChartLineSolid: solid, ChartLineNone: noLn, ChartLineAutomatic: solid},
|
||||
Scatter: {ChartLineUnset: noLn, ChartLineSolid: solid, ChartLineNone: noLn, ChartLineAutomatic: noLn},
|
||||
}[opts.Type]; ok {
|
||||
return chartSeriesSpPr
|
||||
return chartSeriesSpPr[opts.Series[i].Line.Type]
|
||||
}
|
||||
if spPr.SolidFill.SrgbClr != nil {
|
||||
return spPr
|
||||
|
|
30
xmlChart.go
30
xmlChart.go
|
@ -301,21 +301,21 @@ type cView3D struct {
|
|||
// plot area of the chart.
|
||||
type cPlotArea struct {
|
||||
Layout *string `xml:"layout"`
|
||||
AreaChart *cCharts `xml:"areaChart"`
|
||||
Area3DChart *cCharts `xml:"area3DChart"`
|
||||
BarChart *cCharts `xml:"barChart"`
|
||||
Bar3DChart *cCharts `xml:"bar3DChart"`
|
||||
BubbleChart *cCharts `xml:"bubbleChart"`
|
||||
DoughnutChart *cCharts `xml:"doughnutChart"`
|
||||
LineChart *cCharts `xml:"lineChart"`
|
||||
Line3DChart *cCharts `xml:"line3DChart"`
|
||||
PieChart *cCharts `xml:"pieChart"`
|
||||
Pie3DChart *cCharts `xml:"pie3DChart"`
|
||||
OfPieChart *cCharts `xml:"ofPieChart"`
|
||||
RadarChart *cCharts `xml:"radarChart"`
|
||||
ScatterChart *cCharts `xml:"scatterChart"`
|
||||
Surface3DChart *cCharts `xml:"surface3DChart"`
|
||||
SurfaceChart *cCharts `xml:"surfaceChart"`
|
||||
AreaChart []*cCharts `xml:"areaChart"`
|
||||
Area3DChart []*cCharts `xml:"area3DChart"`
|
||||
BarChart []*cCharts `xml:"barChart"`
|
||||
Bar3DChart []*cCharts `xml:"bar3DChart"`
|
||||
BubbleChart []*cCharts `xml:"bubbleChart"`
|
||||
DoughnutChart []*cCharts `xml:"doughnutChart"`
|
||||
LineChart []*cCharts `xml:"lineChart"`
|
||||
Line3DChart []*cCharts `xml:"line3DChart"`
|
||||
PieChart []*cCharts `xml:"pieChart"`
|
||||
Pie3DChart []*cCharts `xml:"pie3DChart"`
|
||||
OfPieChart []*cCharts `xml:"ofPieChart"`
|
||||
RadarChart []*cCharts `xml:"radarChart"`
|
||||
ScatterChart []*cCharts `xml:"scatterChart"`
|
||||
Surface3DChart []*cCharts `xml:"surface3DChart"`
|
||||
SurfaceChart []*cCharts `xml:"surfaceChart"`
|
||||
CatAx []*cAxs `xml:"catAx"`
|
||||
ValAx []*cAxs `xml:"valAx"`
|
||||
SerAx []*cAxs `xml:"serAx"`
|
||||
|
|
Loading…
Reference in New Issue