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

timeline with multiple-y-axis setting y axis doesn't work #601

Open
pizifan opened this issue Dec 12, 2023 · 0 comments
Open

timeline with multiple-y-axis setting y axis doesn't work #601

pizifan opened this issue Dec 12, 2023 · 0 comments

Comments

@pizifan
Copy link

pizifan commented Dec 12, 2023

I‘d want to expand the demo of multiple-y-axis (url: https://echarts.apache.org/examples/en/editor.html?c=multiple-y-axis) with timeline to show the different years of data changes.
when I use it without timeline it works well as below:
image

but when i use timeline it doesn't work :
image

here are my codes:
test %>%
e_charts(month) %>%
e_bar(Evaporation,name='Evaporation',y_index=1)%>%
e_bar(Precipitation,name='Precipitation',y_index=2)%>%
e_line(Temperature,name='temperature',lineStyle=list(color='#EE6666')) %>%
e_y_axis(index =0 ,name='temperature', axisLine=list(show=T,lineStyle=list(color='#EE6666')),
makepoint=list(symbol = 'circle'))%>%
#e_grid(right='20%') %>%
e_y_axis(index = 1, name = "Evaporation",type='value',
alignTicks=T,axisLine=list(show=T,lineStyle=list(color='#5470C6')),
axisLabel=list( formatter='{value} ml'),
splitLine=list(show=F)) |>
e_y_axis(index=2, name = "Precipitation",offset=80,type='value',
alignTicks=T,axisLine=list(show=T,lineStyle=list(color='#91CC75')),
axisLabel=list( formatter='{value} ml'),
splitLine=list(show=F))%>%
e_axis( type= 'category',
axisTick=list(alignWithLabel= T))%>%
e_mark_point("temperature", data = list(
name = "Max",
type = "max" ))%>%
e_mark_point("temperature", data = list(
name = "Min",
type = "min" ))%>%
e_tooltip(trigger = 'axis', axisPointer=list( type='cross'))

with timeline codes:
timeline_data%>%
group_by(year)%>%
e_charts(month,timeline = T)%>%
e_bar(Evaporation,name='Evaporation',y_index=1)%>%
e_bar(Precipitation,name='Precipitation',y_index=2)%>%
e_line(Temperature,name='temperature',lineStyle=list(color='#EE6666'),y_index=0) %>%
e_y_axis(index =0 ,name='temperature',position='left', type='value',
axisLine=list(show=T,lineStyle=list(color='#EE6666')),
makepoint=list(symbol = 'circle'))%>%
#e_grid(right='20%') %>%
e_y_axis(index = 1, name = "Evaporation",type='value',position='right',
alignTicks=T,axisLine=list(show=T,lineStyle=list(color='#5470C6')),
axisLabel=list( formatter='{value} ml'),
splitLine=list(show=F)) %>%
e_y_axis(index=2, name = "Precipitation",offset=50,type='value',position='right',
alignTicks=T,axisLine=list(show=T,lineStyle=list(color='#91CC75')),
axisLabel=list( formatter='{value} ml'),
splitLine=list(show=F))%>%
e_axis( type= 'category',
axisTick=list(alignWithLabel= T))%>%
e_tooltip(trigger = 'axis', axisPointer=list( type='cross'))

e_y_axis setting seems work on the last index .
Could you help me to solve it ? Thanks a lot!

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

No branches or pull requests

2 participants