Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ const (
WireframeContour
Bubble
Bubble3D
HighLowCloseChart
OpenHighLowCloseChart
)

// ChartDashType is the type of supported chart dash types.
Expand Down Expand Up @@ -755,6 +757,8 @@ func (opts *Chart) parseTitle() {
// 52 | WireframeContour | wireframe contour chart
// 53 | Bubble | bubble chart
// 54 | Bubble3D | 3D bubble chart
// 55 | HighLowCloseChart | High-Low-Close stock chart
// 56 | OpenHighLowCloseChart | Open-High-Low-Close stock chart
//
// In Excel a chart series is a collection of information that defines which
// data is plotted such as values, axis labels and formatting.
Expand Down
22 changes: 22 additions & 0 deletions drawing.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ func (f *File) addChart(opts *Chart, comboCharts []*Chart) {
WireframeContour: f.drawSurfaceChart,
Bubble: f.drawBubbleChart,
Bubble3D: f.drawBubbleChart,
HighLowCloseChart: f.drawStockChart,
OpenHighLowCloseChart: f.drawStockChart,
}
xlsxChartSpace.Chart.drawChartLegend(opts)
xlsxChartSpace.Chart.PlotArea.SpPr = f.drawShapeFill(opts.PlotArea.Fill, xlsxChartSpace.Chart.PlotArea.SpPr)
Expand Down Expand Up @@ -689,6 +691,26 @@ func (f *File) drawBubbleChart(pa *cPlotArea, opts *Chart) *cPlotArea {
return plotArea
}

func (f *File) drawStockChart(pa *cPlotArea, opts *Chart) *cPlotArea {
plotArea := &cPlotArea{
StockChart: []*cCharts{
{
VaryColors: &attrValBool{
Val: opts.VaryColors,
},
Ser: f.drawChartSeries(opts),
DLbls: f.drawChartDLbls(opts),
AxID: f.genAxID(opts),
},
},
ValAx: f.drawPlotAreaValAx(pa, opts),
DateAx: f.drawPlotAreaCatAx(pa, opts),
}
ser := *plotArea.StockChart[0].Ser
ser[0].Val.NumRef.NumCache = &cNumCache{}
return plotArea
}

// drawChartGapWidth provides a function to draw the c:gapWidth element by given
// format sets.
func (f *File) drawChartGapWidth(opts *Chart) *attrValInt {
Expand Down
2 changes: 2 additions & 0 deletions xmlChart.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ type cPlotArea struct {
DoughnutChart []*cCharts `xml:"doughnutChart"`
LineChart []*cCharts `xml:"lineChart"`
Line3DChart []*cCharts `xml:"line3DChart"`
StockChart []*cCharts `xml:"stockChart"`
PieChart []*cCharts `xml:"pieChart"`
Pie3DChart []*cCharts `xml:"pie3DChart"`
OfPieChart []*cCharts `xml:"ofPieChart"`
Expand All @@ -365,6 +366,7 @@ type cPlotArea struct {
SurfaceChart []*cCharts `xml:"surfaceChart"`
CatAx []*cAxs `xml:"catAx"`
ValAx []*cAxs `xml:"valAx"`
DateAx []*cAxs `xml:"dateAx"`
SerAx []*cAxs `xml:"serAx"`
DTable *cDTable `xml:"dTable"`
SpPr *cSpPr `xml:"spPr"`
Expand Down