Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x轴数据显示不全的问题, 求助 #58

Closed
lianxmfor opened this issue Apr 7, 2020 · 6 comments
Closed

x轴数据显示不全的问题, 求助 #58

lianxmfor opened this issue Apr 7, 2020 · 6 comments

Comments

@lianxmfor
Copy link

x轴数据较多的话会有数据显示不全, 我没有在文档中找到相应的解决办法= = , 请问有什么方法可以让它显示全吗?

@chenjiandongx
Copy link
Member

可以把 X 轴的 Label 旋转

@ioworker0
Copy link

x轴数据较多的话会有数据显示不全, 我没有在文档中找到相应的解决办法= = , 请问有什么方法可以让它显示全吗?

x轴数据较多的话会有数据显示不全, 我没有在文档中找到相应的解决办法= = , 请问有什么方法可以让它显示全吗?

兄弟直接改源码吧,挺简单的。

func (c *Bar) validateOpts() {
	c.XAxisOptsList[0].Data = c.xAxisData
	c.XAxisOptsList[0].AxisLabel =AxisLabelOpts{Rotate: 20} // 20是旋转角度
        // ...
}

// github.com/go-echarts/go-echarts/charts/components.go
// XAxisOpts is the option set for X axis.
type XAxisOpts struct {
// ...
GridIndex int `json:"gridIndex,omitempty"`
// X 轴在 grid 区域中的分隔区域配置项
SplitArea SplitAreaOpts `json:"splitArea,omitempty"`
// X 轴在 grid 区域中的分隔线配置项
SplitLine SplitLineOpts `json:"splitLine,,omitempty"`

AxisLabel AxisLabelOpts `json:"axisLabel"` // 增加一个成员
}

type AxisLabelOpts struct {
	Interval int `json:"interval"`
	Rotate int `json:"rotate"`
}

@ioworker0
Copy link

可以把 X 轴的 Label 旋转

把x轴的一些配置暴露出来呗

@lianxmfor
Copy link
Author

可以把 X 轴的 Label 旋转

把x轴的一些配置暴露出来呗

x轴数据较多的话会有数据显示不全, 我没有在文档中找到相应的解决办法= = , 请问有什么方法可以让它显示全吗?

x轴数据较多的话会有数据显示不全, 我没有在文档中找到相应的解决办法= = , 请问有什么方法可以让它显示全吗?

兄弟直接改源码吧,挺简单的。

func (c *Bar) validateOpts() {
	c.XAxisOptsList[0].Data = c.xAxisData
	c.XAxisOptsList[0].AxisLabel =AxisLabelOpts{Rotate: 20} // 20是旋转角度
        // ...
}

// github.com/go-echarts/go-echarts/charts/components.go
// XAxisOpts is the option set for X axis.
type XAxisOpts struct {
// ...
GridIndex int `json:"gridIndex,omitempty"`
// X 轴在 grid 区域中的分隔区域配置项
SplitArea SplitAreaOpts `json:"splitArea,omitempty"`
// X 轴在 grid 区域中的分隔线配置项
SplitLine SplitLineOpts `json:"splitLine,,omitempty"`

AxisLabel AxisLabelOpts `json:"axisLabel"` // 增加一个成员
}

type AxisLabelOpts struct {
	Interval int `json:"interval"`
	Rotate int `json:"rotate"`
}

非常感谢!

@ioworker0
Copy link

可以把 X 轴的 Label 旋转

把x轴的一些配置暴露出来呗

x轴数据较多的话会有数据显示不全, 我没有在文档中找到相应的解决办法= = , 请问有什么方法可以让它显示全吗?

x轴数据较多的话会有数据显示不全, 我没有在文档中找到相应的解决办法= = , 请问有什么方法可以让它显示全吗?

兄弟直接改源码吧,挺简单的。

func (c *Bar) validateOpts() {
	c.XAxisOptsList[0].Data = c.xAxisData
	c.XAxisOptsList[0].AxisLabel =AxisLabelOpts{Rotate: 20} // 20是旋转角度
        // ...
}

// github.com/go-echarts/go-echarts/charts/components.go
// XAxisOpts is the option set for X axis.
type XAxisOpts struct {
// ...
GridIndex int `json:"gridIndex,omitempty"`
// X 轴在 grid 区域中的分隔区域配置项
SplitArea SplitAreaOpts `json:"splitArea,omitempty"`
// X 轴在 grid 区域中的分隔线配置项
SplitLine SplitLineOpts `json:"splitLine,,omitempty"`

AxisLabel AxisLabelOpts `json:"axisLabel"` // 增加一个成员
}

type AxisLabelOpts struct {
	Interval int `json:"interval"`
	Rotate int `json:"rotate"`
}

非常感谢!

很开心可以帮助到你,那关闭issue吧。

@yokiy0828
Copy link

你这是怎么改的?改哪个文件?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants