maoruibin / maoruibin/maoruibin.github.com

根据一大串 points 巧妙绘制曲线

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

trick utils
Dominant language
HTML
Stars
22
Forks
4
PR merge metrics
No merged PRs in 30d

Description

for (int i = 0;i<size;i++) {
    Entity data = list.get(i);
    currentPosX = (i + 1) * chartSpace + i * chartWidth;
    currentPosY = getHeight() - mBottomBlankSize - (data.value() / getMaxAqiValue()) * (chartHeight) - mPaddingPopAndChart;
    if (i == 0) {
        mPath.moveTo(currentPosX, currentPosY);
        lastX = currentPosX;
        lastY = currentPosY;
    } else {
        float cX = (currentPosX + lastX) / 2;
        float cY = (currentPosY + lastY) / 2;
        mPath.quadTo(lastX, lastY, cX, cY);
        lastX = currentPosX;
        lastY = currentPosY;
    }
    mControlPoints.add(new PointF(currentPosX, currentPosY));
}

原理即把实际点作为控制点,而目标点通过计算得到

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides a Java code snippet and an explanation of calculating curve points, but names no blog file, test, or entry point. First locate how posts or technical notes are organized in the repository and clarify whether this should become a published article; done is not defined by the current issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
content, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.