vDataFrame.hchart (Beta)¶
In [ ]:
vDataFrame.hchart(x = None,
y = None,
z = None,
c = None,
aggregate: bool = True,
kind = "boxplot",
width: int = 600,
height: int = 400,
options: dict = {},
h: float = -1,
max_cardinality: int = 10,
limit: int = 10000,
drilldown: bool = False,
stock: bool = False,
alpha: float = 0.25)
Draws responsive charts using the High Chart API: https://api.highcharts.com/highcharts/
The returned object can be customized using the API parameters and the 'set_dict_options' method.
⚠ Warning: This function uses the unsupported HighChart Python API. For more information, see python-hicharts repository.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
x / y / z / c | str / list | ✓ | The vcolumns and aggregations used to draw the chart. These will depend on the chart type. You can also specify an expression, but it must be a SQL statement. For example: AVG(column1) + SUM(column2) AS new_name.
area / area_ts / line / spline
area_range
bar (single) / donut / donut3d / hist (single) / pie / pie_half / pie3d
bar (double / drilldown) / hist (double / drilldown) / pie (drilldown) / stacked_bar / stacked_hist
biserial / boxplot / pearson / kendall / pearson / spearman
bubble / scatter
candlestick
negative_bar
spider |
aggregate | bool | ✓ | If set to True, the input vcolumns will be aggregated. |
kind | str | ✓ | Chart Type.
|
width | int | ✓ | Chart Width. |
height | int | ✓ | Chart Height. |
options | dict | ✓ | High Chart Dictionary used to customize the Chart. Look at the API documentation to know the different options. |
h | float | ✓ | Interval width of the bar. If empty, an optimized value will be used. |
max_cardinality | int | ✓ | Maximum number of the vcolumn distinct elements. |
limit | int | ✓ | Maximum number of elements to draw. |
drilldown | bool | ✓ | Drilldown Chart: Only possible for Bars, Histograms, donuts and pies. Instead of drawing 2D charts, this option allows you to add a drilldown effect to 1D Charts. |
stock | bool | ✓ | Stock Chart: Only possible for Time Series. The design of the Time Series is dragable and have multiple options. |
alpha | float | ✓ | Value used to determine the position of the upper and lower quantile (Used when kind is set to 'candlestick') |
In [22]:
from verticapy.datasets import *
titanic = load_titanic()
amazon = load_amazon()
iris = load_iris()
In [7]:
# Heatmap
titanic.hchart(x = "embarked",
y = "pclass",
z = "ROUND(AVG(survived), 2)",
kind = "heatmap")
Out[7]:
In [8]:
# Correlation Matrix
titanic.hchart(kind = "pearson")
Out[8]:
In [21]:
# Boxplot
titanic.hchart(kind = "boxplot")
Out[21]:
In [11]:
# Bar
titanic.hchart(x = "pclass",
y = "AVG(survived)",
kind = "bar")
Out[11]:
In [20]:
# Hist with Drilldown
titanic.hchart(x = "embarked",
y = "pclass",
z = "ROUND(AVG(survived), 2)",
kind = "hist",
drilldown = True)
Out[20]:
In [26]:
# Pie with Drilldown
titanic.hchart(x = "embarked",
y = "pclass",
z = "ROUND(AVG(survived), 2)",
kind = "pie",
drilldown = True)
Out[26]:
In [19]:
# Area Range
amazon.search("YEAR(date) = 2014").hchart(
x = "date",
y = ["AVG(number) AS avg",
"MIN(number) AS min",
"MAX(number) AS max"],
kind = "area_range")
Out[19]:
In [25]:
# Candlestick
amazon.hchart("date",
"number",
kind = "candlestick",
alpha = 0.05)
Out[25]:
In [23]:
# Scatter
iris.hchart(x = "PetalWidthCm",
y = "PetalLengthCm",
c = "Species",
kind = "scatter")
Out[23]:
In [24]:
# Bubble
titanic.hchart(x = "age",
y = "fare",
z = "survived",
c = "pclass",
aggregate = False,
kind = "bubble",
limit = 20)
Out[24]: