1 Star 2 Fork 1

wx-fork/unioffice

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
datalabels.go 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
// Copyright 2017 Baliance. All rights reserved.
//
// Use of this source code is governed by the terms of the Affero GNU General
// Public License version 3.0 as published by the Free Software Foundation and
// appearing in the file LICENSE included in the packaging of this file. A
// commercial license can be purchased by contacting sales@baliance.com.
package chart
import (
"baliance.com/gooxml"
crt "baliance.com/gooxml/schema/schemas.openxmlformats.org/drawingml/2006/chart"
)
type DataLabels struct {
x *crt.CT_DLbls
}
func MakeDataLabels(x *crt.CT_DLbls) DataLabels {
return DataLabels{x}
}
func (d DataLabels) ensureChoice() {
if d.x.Choice == nil {
d.x.Choice = crt.NewCT_DLblsChoice()
}
}
func (d DataLabels) SetPosition(p crt.ST_DLblPos) {
d.ensureChoice()
d.x.Choice.DLblPos = crt.NewCT_DLblPos()
d.x.Choice.DLblPos.ValAttr = p
}
func (d DataLabels) SetShowLegendKey(b bool) {
d.ensureChoice()
d.x.Choice.ShowLegendKey = crt.NewCT_Boolean()
d.x.Choice.ShowLegendKey.ValAttr = gooxml.Bool(b)
}
func (d DataLabels) SetShowValue(b bool) {
d.ensureChoice()
d.x.Choice.ShowVal = crt.NewCT_Boolean()
d.x.Choice.ShowVal.ValAttr = gooxml.Bool(b)
}
func (d DataLabels) SetShowCategoryName(b bool) {
d.ensureChoice()
d.x.Choice.ShowCatName = crt.NewCT_Boolean()
d.x.Choice.ShowCatName.ValAttr = gooxml.Bool(b)
}
func (d DataLabels) SetShowSeriesName(b bool) {
d.ensureChoice()
d.x.Choice.ShowSerName = crt.NewCT_Boolean()
d.x.Choice.ShowSerName.ValAttr = gooxml.Bool(b)
}
func (d DataLabels) SetShowPercent(b bool) {
d.ensureChoice()
d.x.Choice.ShowPercent = crt.NewCT_Boolean()
d.x.Choice.ShowPercent.ValAttr = gooxml.Bool(b)
}
func (d DataLabels) SetShowLeaderLines(b bool) {
d.ensureChoice()
d.x.Choice.ShowLeaderLines = crt.NewCT_Boolean()
d.x.Choice.ShowLeaderLines.ValAttr = gooxml.Bool(b)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wx-fork/unioffice.git
git@gitee.com:wx-fork/unioffice.git
wx-fork
unioffice
unioffice
v0.2.0

搜索帮助