!!!###!!!title=212- What are the methods for data sampling in VChart charts——VisActor/VChart FAQ documents!!!###!!!!!!###!!!description=---title: What are the methods of data sampling in VChart charts?</br>key words: VisActor,VChart,VTable,VStrory,VMind,VGrammar,VRender,Visualization,Chart,Data,Table,Graph,Gis,LLM--- !!!###!!!

Title

What are the methods for data sampling in VChart charts?

Problem Description

May I ask if there are any data sampling configurations in vchart to improve performance when the amount of data in the line chart is large?

Solution

VChart line chart, since the 1.6.0 version supports data sampling method configuration.
The downsampling strategy for line charts when the data volume is much larger than the pixel points can effectively optimize the drawing efficiency of the chart when turned on. It is turned off by default, that is, all drawings without filtering Data Points. Optional values for sampling configuration:

  • 'Lttb' : Using Largest-Triangle-Three-Bucket algorithm, it can maximize the trend, shape and extreme value of the sampled line.
  • 'Min' : Take the minimum value of the filter point
  • 'Max' : take the maximum value of the filter point
  • 'Sum' : take the sum of the filter points
  • 'Average' : Take the average of the filter points
    The sampling effect can be adjusted through the samplingFactor configuration.
sampling: 'lttb',
samplingFactor: 0.1,</br>

Code Example

https://visactor.io/vchart/demo/line-chart/line-sampling

Results

Quote