vCharts (Beta)

In [ ]:
%%vCharts -type auto

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
type
str
Chart Type.
  • area : Area Chart
  • area_range : Area Range Chart
  • area_ts : Area Chart with Time Series Design
  • bar : Bar Chart
  • biserial : Biserial Point Matrix (Correlation between binary variables and numerical)
  • boxplot : Box Plot
  • bubble : Bubble Plot
  • candlestick : Candlestick and Volumes (Time Series Special Plot)
  • cramer : Cramer's V Matrix (Correlation between categories)
  • donut : Donut Chart
  • donut3d : 3D Donut Chart
  • heatmap : Heatmap
  • hist : Histogram
  • kendall : Kendall Correlation Matrix
    ⚠ Warning: This method is computationally expensive. It is using a CROSS JOIN during the computation. The complexity is O(n * n), n being the total count of the vDataFrame.
  • line : Line Plot
  • negative_bar : Multi Bar Chart for binary classes
  • pearson : Pearson Correlation Matrix
  • pie : Pie Chart
  • pie_half : Half Pie Chart
  • pie3d : 3D Pie Chart
  • scatter : Scatter Plot
  • spider : Spider Chart
  • spline : Spline Plot
  • stacked_bar : Stacked Bar Chart
  • stacked_hist : Stacked Histogram
  • spearman : Spearman Correlation Matrix

Returns

Highchart : Chart Object

Example

If you don't already have one, create an auto-connection. This connection will be used to run SQL queries.

In [22]:
from verticapy.connect import *
# Save a new connection
new_auto_connection({"host": "10.211.55.14", 
                     "port": "5433", 
                     "database": "testdb", 
                     "password": "XxX", 
                     "user": "dbadmin"},
                    name = "VerticaDSN")
# Set the primary auto-connection
change_auto_connection("VerticaDSN")

To install the extension, you should run the following command in your terminal.

In [ ]:
pip3 install python-highcharts

You can then load the extension.

In [2]:
%load_ext verticapy.vCharts

You can draw responsive charts using SQL queries.

In [3]:
%%vCharts -type line
SELECT 
    date, 
    SUM(deaths) AS deaths,
    SUM(cases) AS cases
FROM covid19_deaths
GROUP BY 1;
Execution: 0.232s
Out[3]:
In [4]:
%%vCharts -type heatmap
SELECT
    CORR_MATRIX(PetalLengthCm, 
                PetalWidthCm, 
                SepalLengthCm) OVER ()
FROM iris;
Execution: 0.187s
Out[4]:
In [5]:
%%vCharts -type hist
SELECT
    pclass, 
    SUM(survived)
FROM titanic GROUP BY 1;
Execution: 0.176s
Out[5]:
In [6]:
%%vCharts -type scatter
SELECT 
    PetalLengthCm, 
    PetalWidthCm, 
    Species
FROM iris;
Execution: 0.17s
Out[6]:
In [7]:
%%vCharts -type spearman
SELECT * FROM titanic;
Execution: 0.174s
Out[7]:
In [8]:
%%vCharts -type boxplot
SELECT * FROM titanic;
Execution: 0.226s
Out[8]: