line graph like google weather graph
Asked Answered
S

0

1

I have UI requirement with ling graph, the graph will be have icons above xaxis just like google weather app UI. Following image is reference.

enter image description here

Like above image wee need to display icons for the graph.I have previously used MPAndroidChart. I have tried different concepts available in google and SO. still unable achieve this UI.

I have followed following articles

To show icons in bar chart

When any value click showing icon

If anyone knows how to implement this UI, help me out.

Septate answered 22/10, 2019 at 11:31 Comment(7)
Did you try using canvas along with horizontal recyclerview?Aleenaleetha
@Karrthik i need graph also if u see the image based on value it will up and down with recyclerview we can't create the difference.Septate
Actually we can do it using canvas, dividing the height into equal parts using temperature vertically for each item, selecting the part for each recyclerview item based on the temperture and drawing a border accordingly filling the below space with that particular color.Aleenaleetha
Give me two days, I will try this out and will let you know.Aleenaleetha
@Karrthik Tq for ur help , in the meanwhile can you give me little bit more explanation so that from my end i will also try.Septate
In a recycler view try to divide height into equal parts based on the temperatures which is along the y-axis. and dates will be along x-axis. you know the previous day and previous day temperature and you will find the co ordinates (x and y). Get the current day and current day temperature, you will find the next co ordinates where you need to draw a border. And fill the inner part with a different color. Do it for each day.Aleenaleetha
@Karrthik can you help me regarding this problem, i had tried ur suggestion unable to achieve it.Septate

© 2022 - 2024 — McMap. All rights reserved.