Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

advanced animation chart does not show at page load #51

Open
binoysarker opened this issue Jun 11, 2020 · 0 comments
Open

advanced animation chart does not show at page load #51

binoysarker opened this issue Jun 11, 2020 · 0 comments

Comments

@binoysarker
Copy link

binoysarker commented Jun 11, 2020

Hello sir, my chart is inside third tab in the tab list so that's why when i go to that tab and when i drag the developer tab i mean the console window or just resize then the chart shows with animation. What can i do so that i don't have to do that.

<div class="row">
                <div class="col-md-12">
                  <div class="card">
                    <div class="card-header">
                      <h5 class="card-title">Mints & Burns</h5>
                    </div>
                    <div class="card-body" v-if="transectionMintBurnListItems">
                      <TableComponent
                        :tableCurrentPage="currentPage3"
                        :totalRows="totalRows3"
                        :perPage="perPage3"
                        :tableListItems="transectionMintBurnListItems"
                        :tablefields="transectionMintBurnfields"
                        :onPageChanged="onPageChangedForMintBurn"
                      />
                    </div>
                  </div>
                </div>
              </div>

<script>
export default {
data(){
return {
chartForMintBurn: {
        data: {
          labels: [
            "1",
            "2",
            "3",
            "4",
            "5",
            "6",
            "7",
            "8",
            "9",
            "10",
            "11",
            "12"
          ],
          series: [
            [12, 9, 7, 8, 5, 4, 6, 2, 3, 3, 4, 6],
            [4, 5, 3, 7, 3, 5, 5, 3, 4, 4, 5, 5],
            [5, 3, 4, 5, 6, 3, 3, 4, 5, 6, 3, 4],
            [3, 4, 5, 6, 7, 6, 4, 5, 6, 7, 6, 3]
          ]
        },
        options: {
          low: 0,
          showArea: false,
          fullWidth: true,
          stretch: true,
        },
        eventHandlers: [
          {
            event: "draw",
            fn(data) {
              seq++;
              if (data.type === "line") {
                data.element.animate({
                  opacity: {
                    begin: seq * delays + 1000,
                    dur: durations,
                    from: 0,
                    to: 1
                  }
                });
              } else if (data.type === "label" && data.axis === "x") {
                data.element.animate({
                  y: {
                    begin: seq * delays,
                    dur: durations,
                    from: data.y + 100,
                    to: data.y,
                    easing: "easeOutQuart"
                  }
                });
              } else if (data.type === "label" && data.axis === "y") {
                data.element.animate({
                  x: {
                    begin: seq * delays,
                    dur: durations,
                    from: data.x - 100,
                    to: data.x,
                    easing: "easeOutQuart"
                  }
                });
              } else if (data.type === "point") {
                data.element.animate({
                  x1: {
                    begin: seq * delays,
                    dur: durations,
                    from: data.x - 10,
                    to: data.x,
                    easing: "easeOutQuart"
                  },
                  x2: {
                    begin: seq * delays,
                    dur: durations,
                    from: data.x - 10,
                    to: data.x,
                    easing: "easeOutQuart"
                  },
                  opacity: {
                    begin: seq * delays,
                    dur: durations,
                    from: 0,
                    to: 1,
                    easing: "easeOutQuart"
                  }
                });
              } else if (data.type === "grid") {
                var pos1Animation = {
                  begin: seq * delays,
                  dur: durations,
                  from: data[data.axis.units.pos + "1"] - 30,
                  to: data[data.axis.units.pos + "1"],
                  easing: "easeOutQuart"
                };
                var pos2Animation = {
                  begin: seq * delays,
                  dur: durations,
                  from: data[data.axis.units.pos + "2"] - 100,
                  to: data[data.axis.units.pos + "2"],
                  easing: "easeOutQuart"
                };
                var animations = {};
                animations[data.axis.units.pos + "1"] = pos1Animation;
                animations[data.axis.units.pos + "2"] = pos2Animation;
                animations["opacity"] = {
                  begin: seq * delays,
                  dur: durations,
                  from: 0,
                  to: 1,
                  easing: "easeOutQuart"
                };
                data.element.animate(animations);
              }
            }
          }
        ]
      },
}
}
}
</script>

Please help me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant