Visitar URL original
instance meta margin not being set · Issue #74 · mauriciopoppe/function-plot · GitHub
Skip to content

instance meta margin not being set #74

Closed

Description

@jcandan

expected behavior:
the following should redraw the chart with a new bottom margin:

instance.meta.margin.bottom = 40;
instance.draw();

current behavior:
the new margin is not applied.

possible solution:
in lib/index.js, build() is only called once on init. it's the only time that the internalVars() method is called which is where the meta.margin object is set to the instance margin. a call to internalVars() should be added to the draw() method.

Activity

  1. mauriciopoppe commented on Sep 8, 2016

    @mauriciopoppe
    Owner

    instance.draw only redraws everything inside data, if you modify an option outside this field you should call build instead, however, the following won't work

    instance.meta.margin.bottom = 40;
    instance.build();

    This is because build recomputes all the properties of meta, in fact meta should be read only as far as I remember.

    I'm going to tinker about a good solution for this problem since I want draw to only draw data, I think that there should be another method which redraws everything but also doesn't recompute everything from scratch.

  2. stale commented on Aug 24, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions