You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/09/07 17:11:19 UTC
[GitHub] geekboy0801 edited a comment on issue #9026: Axis Label overlapping
geekboy0801 edited a comment on issue #9026: Axis Label overlapping
URL: https://github.com/apache/incubator-echarts/issues/9026#issuecomment-419505622
Hi, @100pah . I am now using ReactEchart component. And the code stuff is as below.
eChartOption(graphData, xAxisCategories) {
const yAxisLines = this.getYAxisLines(graphData, xAxisCategories);
......
const chartOption = {
animation: false,
legend,
xAxis: [{
type: 'category',
axisLine: { show: false },
axisTick: { show: false },
axisLabel: {
color: '#888',
rotate: isLarge ? 0 : 45,
margin: 12,
},
data: xAxisCategories.toArray(),
}],
yAxis: {
name: 'Operation Time (minutes)',
nameLocation: 'middle',
nameTextStyle: {
color: '#aaa',
},
nameGap: 35,
type: 'value', //--------------------------------------------------------------------------------
axisTick: { show: false },
axisLine: { show: false },
splitLine: { show: false },
axisLabel: {
color: '#888',
},
},
grid: {
left: 40,
right: 10,
bottom: (this.props.operationType === W2W_OPTYPE) ? 50 : 25,
top: 10,
containLabel: true,
show: true,
borderWidth: 0,
},
tooltip: {
trigger: 'item',
axisPointer: {
type: 'shadow',
},
backgroundColor: 'rgba(221,221,221,0.9)',
borderColor: '#198bff',
borderWidth: 1,
textStyle: {
color: '#000',
},
},
series: [...series, {
name: 'Goal Line',
type: 'line',
markLine: {
silent: true,
symbol: 'none',
data: yAxisLines.map(yAxisLine => ({
yAxis: yAxisLine.get('value'),
lineStyle: {
normal: {
color: yAxisLine.get('color'),
type: 'solid',
},
},
label: {
normal: {
position: yAxisLine.get('position'),
formatter: `{style|${yAxisLine.get('text')}}`,
color: yAxisLine.get('color'),
rich: {
style: {
width: '100%',
align: yAxisLine.get('align'),
padding: [0, 0, -15, 0],
rotation: 90,
},
},
},
},
})).toArray(),
},
}],
};
return chartOption;
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org