Skip to content

Caching charts #5

@Munken

Description

@Munken

As mentioned early some charts are quite slow to render. Some of this can be solved by rendering to an image an then just have CN1 draw this.

Currently I use this code to achieve it:

    private static Image g(GraphicalView g, int w, int h) {
        Image buf = Image.createImage(w, h, 0xF0F0F0);
        buf.getGraphics().setClip(0, 0, w, h);

        Canvas canvas = new Canvas();
        Paint paint = new Paint();
        canvas.g = buf.getGraphics();
        Paint.g = buf.getGraphics();
        g.getChart().draw(canvas, 0, 0, w, h, paint);

        return buf;
    }

There should however be a way to invalidate the cache or it should detect automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions