charts
Charts engine for output window.
Attributes
CHARTS_ENGINE = 'Chart.bundle.js'
module-attribute
LINE_CHART = 'line'
module-attribute
BAR_CHART = 'bar'
module-attribute
RADAR_CHART = 'radar'
module-attribute
POLAR_CHART = 'polarArea'
module-attribute
PIE_CHART = 'pie'
module-attribute
DOUGHNUT_CHART = 'doughnut'
module-attribute
BUBBLE_CHART = 'bubble'
module-attribute
CHARTS_JS_PATH = 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/{version}/Chart.min.js'
module-attribute
SCRIPT_TEMPLATE = "var ctx = document.getElementById('{canvas_id}').getContext('2d');var chart = new Chart(ctx, {canvas_code});"
module-attribute
Classes
PyRevitOutputChartOptions()
PyRevitOutputChartDataset(label)
Bases: object
Chart dataset wrapper object.
Source code in pyrevitlib/pyrevit/coreutils/charts.py
Attributes
label = label
instance-attribute
data = []
instance-attribute
backgroundColor = ''
instance-attribute
Functions
set_color(*args)
Set dataset color.
Arguments are expected to be R, G, B, A values.
Examples:
Source code in pyrevitlib/pyrevit/coreutils/charts.py
PyRevitOutputChartData()
Bases: object
Chart data wrapper object.
Source code in pyrevitlib/pyrevit/coreutils/charts.py
Attributes
labels = ''
instance-attribute
datasets = []
instance-attribute
Functions
new_dataset(dataset_label)
Create new data set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dataset_label |
str
|
dataset label |
required |
Returns:
Type | Description |
---|---|
PyRevitOutputChartDataset
|
dataset wrapper object |
Examples:
Source code in pyrevitlib/pyrevit/coreutils/charts.py
PyRevitOutputChart(output, chart_type=LINE_CHART, version=None)
Bases: object
Chart wrapper object for output window.
Attributes:
Name | Type | Description |
---|---|---|
output |
PyRevitOutputWindow
|
output window wrapper object |
chart_type |
str
|
chart type name |
Source code in pyrevitlib/pyrevit/coreutils/charts.py
Attributes
type = chart_type
instance-attribute
data = PyRevitOutputChartData()
instance-attribute
options = PyRevitOutputChartOptions()
instance-attribute
Functions
randomize_colors()
Randomize chart datasets colors.
Source code in pyrevitlib/pyrevit/coreutils/charts.py
set_width(width)
set_height(height)
set_style(html_style)
Set chart styling.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
html_style |
str
|
inline html css styling string |
required |
Examples:
draw()
Request chart to draw itself on output window.