Closed Joselinah closed 10 months ago
I was able to solve my problem with this #195 If anyone has the same question, here is my solution:
I defined colors
and added e_color(colors)
output$linechart <- renderEcharts4r({
colors <- c(
"blue","#C93312","#446455","blue","brown","green")
data <- PMK_gesamtDE_Jahrdf %>%
dplyr::filter(Phänomen %in% input$phäno1 &
Jahr %in% input$jahr1)
data %>%
group_by(Phänomen)%>%
e_charts(Jahr)%>%
e_line(serie=Anzahl, smooth=FALSE)%>%
e_axis_labels(x="Jahr")%>%
e_x_axis(show=TRUE, axisTick=FALSE, axisLine=list(show=FALSE)) %>%
e_title("Gesamtanzahl Deutschland", "politisch motivierte Kriminalität")%>%
e_tooltip(trigger = "axis", order="valueDesc")%>%
e_mark_point(input$phäno1, data=list(type="max"))%>%
e_toolbox(bottom=0)%>%
e_toolbox_feature(feature = "dataZoom")%>%
e_toolbox_feature(feature = "dataView")%>%
e_color(colors)
})}
Regards :)
@Joselinah I guess you also could have added one more line to your first echarts attempt:
e_add_nested("lineStyle", color)
Hi,
I would like to customize the line color in the chart so that when I select a value, it takes on a specific color. Currently I only managed to get the points in the desired color with
e_add_nested("itemStyle", color)
.Is this possible and could someone please help me with this?
Thanks for help!