Skip to content
On this page

VChart

Chart made with SVG, supports polylines printing and display setting.

Import

js
import { VChart } from 'vui-vc-next'

app.component(VChart.name, VChart)

API

Chart Props

PropsDescriptionTypeDefaultRequired
sizeThe size of chart, the value can be a string or number with unit (px)Array[480, 320]-
maxThe maximum in Y-AxisNumberLeave it as blank to automatically calculate the maximum in the dataset-
minThe minimum in Y-AxisnumberLeave it as blank to automatically calculate the minimum in the dataset-
linesThe number of lines in Y-AxisNumber5-
stepThe decreasing step in Y-AxisNumberLeave it as blank to automatically compute the avarage based on lines,max and min-
formatThe labels formatting function in Y-AxisFunctionval => val-
labelsThe labels of X-AxisArray-required
datasetsThe chart data, the format is shown as followsArray-required
shiftThe shift in Y-AxisNumber0.6-

datasets

Array of objects, each object defines a set of polyline-relevant attributes.

js
{
  color: '#ff5858', // storke color, optional, default color is orange
  theme: 'heat',    // theme, the value could be 'heat' or 'region', default value is empty
  width: 1,         // width, optional, default value is 1
  values: [15, 20]  // array
}