iOS-Charts chart draws a parallel X-axis linear indicator

Friends who raise kittens come to my shop! Douyin mall search #早晚早得的猫小店子

Recently, I need to draw histograms and line charts for my project, and I introduced the third-party icon library Charts.

This chart library can basically meet everyone's needs for chart drawing, but the explanation of the api interface is not very detailed. The library has powerful functions, and it is interesting to study it in depth. There are quite a lot of related basic resources on the Internet, but some of the expanded content is not small, and you need to debug and optimize Charts by yourself

For the data itself has different upper and lower amplitude deviations, the initial design idea of ​​​​drawing the entire line block is to draw multiple lines to piece together, but there are many problems

There will be gaps between the lines, which will cause some mobile phones to have blank spaces in the horizontal and vertical screens. The
line drawing of high values ​​and low values ​​will become worse, and a line will be clearly displayed, which is very intuitive to the naked eye.

Re-modify the idea, still use lines to draw, but not multiple lines to draw together

Use the line fill method to fill the color, and then modify the drawing method of the line fill, and dynamically modify the bottom positioning to the specified value

GitHub address: JadeLearn

Guess you like

Origin blog.csdn.net/zxc8890304/article/details/129336272