ChartType
Chart types
Enum Members:
BAR
(“bar”)LINE
(“line”)PIE
(“pie”)SCATTER
(“scatter”)UNKNOWN
(“unknown”)
parseChart()
function parseChart(data: any): Chart
Parameters:
data
any
Returns:
Chart
BarChart
type BarChart = Chart2D & { elements: BarData[]; type: BAR;};
Represents a bar chart with metadata.
Type declaration:
elements
BarData[] - The bars of the charttype
BAR - The type of chart
BarData
type BarData = { group: string; label: string; value: string;};
Represents a bar in a bar chart.
Type declaration:
group
string - The group of the barlabel
string - The label of the barvalue
string - The value of the bar
BoxAndWhiskerChart
type BoxAndWhiskerChart = Chart2D & { elements: BoxAndWhiskerData[]; type: BOX_AND_WHISKER;};
Represents a box and whisker chart with metadata.
Type declaration:
elements
BoxAndWhiskerData[] - The box and whiskers of the charttype
BOX_AND_WHISKER - The type of chart
BoxAndWhiskerData
type BoxAndWhiskerData = { first_quartile: number; label: string; max: number; median: number; min: number; outliers: number[];};
Represents a box and whisker in a box and whisker chart.
Type declaration:
first\_quartile
number - The first quartile of the box and whiskerlabel
string - The label of the box and whiskermax
number - The third quartile of the box and whiskermedian
number - The median of the box and whiskermin
number - The minimum value of the box and whiskeroutliers
number[]
Chart
type Chart = { elements: any[]; png: string; title: string; type: ChartType;};
Represents a chart with metadata from matplotlib.
Type declaration:
elements
any[] - The elements of the chartpng?
string - The PNG representation of the chart encoded in base64title
string - The title of the charttype
ChartType - The type of chart
Chart2D
type Chart2D = Chart & { x_label: string; y_label: string;};
Represents a 2D chart with metadata.
Type declaration:
x\_label?
string - The label of the x-axisy\_label?
string - The label of the y-axis
CompositeChart
type CompositeChart = Chart & { elements: Chart[]; type: COMPOSITE_CHART;};
Represents a composite chart with metadata.
Type declaration:
elements
Chart[] - The charts of the composite charttype
COMPOSITE_CHART - The type of chart
LineChart
type LineChart = PointChart & { type: LINE;};
Represents a line chart with metadata.
Type declaration:
type
LINE - The type of chart
PieChart
type PieChart = Chart & { elements: PieData[]; type: PIE;};
Represents a pie chart with metadata.
Type declaration:
elements
PieData[] - The pie slices of the charttype
PIE - The type of chart
PieData
type PieData = { angle: number; label: string; radius: number;};
Represents a pie slice in a pie chart.
Type declaration:
angle
number - The angle of the pie slicelabel
string - The label of the pie sliceradius
number - The radius of the pie slice
PointChart
type PointChart = Chart2D & { elements: PointData[]; x_scale: string; x_tick_labels: string[]; x_ticks: (number | string)[]; y_scale: string; y_tick_labels: string[]; y_ticks: (number | string)[];};
Represents a point chart with metadata.
Type declaration:
elements
PointData[] - The points of the chartx\_scale
string - The scale of the x-axisx\_tick\_labels
string[] - The labels of the x-axisx\_ticks
(number | string)[] - The ticks of the x-axisy\_scale
string - The scale of the y-axisy\_tick\_labels
string[] - The labels of the y-axisy\_ticks
(number | string)[] - The ticks of the y-axis
PointData
type PointData = { label: string; points: [number | string, number | string][];};
Represents a point in a 2D chart.
Type declaration:
label
string - The label of the pointpoints
[number | string, number | string][] - The points of the chart
ScatterChart
type ScatterChart = PointChart & { type: SCATTER;};
Represents a scatter chart with metadata.
Type declaration:
type
SCATTER - The type of chart