As animações permitem que você facilite a série à medida que carrega uma nova fonte de dados. A animação disponível difere dependendo do tipo de série envolvida. Por exemplo, a série de colunas é animada subindo do eixo x, uma série de linhas é animada desenhando a partir da origem do eixo y.
Animations are disabled in the Ignite UI for Web Components Charts, but they can be enabled by setting the isTransitionInEnabled property to true. From there, you can set the transitionInDuration property to determine how long your animation should take to complete and the transitionInMode to determine the type of animation that takes place.
Web Components Chart Animation Example
O exemplo a seguir descreve um gráfico de linhas com uma animação definida como o padrão transitionInMode "Auto". A lista suspensa e o controle deslizante na parte superior neste exemplo permitirão que você modifique o transitionInMode e transitionInDuration, respectivamente, para que você possa ver como as diferentes animações suportadas se parecem em diferentes velocidades.
<!DOCTYPE html><html><head><title>CategoryChartLineChartWithAnimations</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png"><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css"type="text/css" /></head><body><divid="root"><divclass="container sample"><divclass="options horizontal"><spanclass="options-label">Transition Type </span><selectid="animationSelect"><option>Auto</option><option>AccordionFromBottom</option><option>AccordionFromCategoryAxisMaximum</option><option>AccordionFromCategoryAxisMinimum</option><option>AccordionFromLeft</option><option>AccordionFromRight</option><option>AccordionFromTop</option><option>AccordionFromValueAxisMaximum</option><option>AccordionFromValueAxisMinimum</option><option>Expand</option><option>FromZero</option><option>SweepFromBottom</option><option>SweepFromCategoryAxisMaximum</option><option>SweepFromCategoryAxisMinimum</option><option>SweepFromCenter</option><option>SweepFromLeft</option><option>SweepFromRight</option><option>SweepFromTop</option><option>SweepFromValueAxisMaximum</option><option>SweepFromValueAxisMinimum</option></select><labelid="transitionLabel"class="options-value"style="width: 75px">1000ms</label><inputid="transitionSlider"class="options-slider"type="range"min="50"max="2000"step="50"value="1000" /><buttonid="reloadChartBtn">Reload Chart</button></div><igc-category-chartid="chart"width="100%"height="calc(100% - 30px)"chart-type="Line"is-transition-in-enabled="true"is-horizontal-zoom-enabled="false"is-vertical-zoom-enabled="false"y-axis-title="TWh"y-axis-title-left-margin="10"y-axis-title-right-margin="5"y-axis-label-left-margin="0"computed-plot-area-margin-mode="Series"></igc-category-chart></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %><scriptsrc="src/index.ts"></script><% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
Like this sample? Get access to our complete Ignite UI for Web Components toolkit and start building your own apps in minutes. Download it for free.
Additional Resources
Você pode encontrar mais informações sobre recursos de gráfico relacionados nestes tópicos: