HeatCharts
Constructor
Caliper.HeatCharts
Initializes a new instance of the class with default settings
Properties
| Name | Type | Contents |
|---|---|---|
| XLabelHeight | int | Height of X-Label row. Default is 150 |
| YLabelWidth | int | Width of Y-Label column. Default is 150 |
| DataCellWidth | int | Width of data cell. Default value is 50 |
| DataCellHeight | int | Height of data cell. Default value is 50 |
| Method | string | Heat chart generation method. Default is "Simple". One of "Simple", "Table", "StackedTable" |
| HideCellLabels | bool | Default is true |
Methods
SetChartTitle(array opts)
Title options
| Option | Type | Description | |
|---|---|---|---|
| opts | array | ||
| Title | string | Chart title text | |
| Font | array | Font definition Name (string), Size (int), Bold (boolean) | |
SetXAxisTitle(array opts)
X Axis Title
| Option | Type | Description | |
|---|---|---|---|
| opts | array | ||
| Title | string | Chart title text | |
| Font | array | Font definition Name (string), Size (int), Bold (boolean) | |
SetYAxisTitle(array opts)
X Axis Title
| Option | Type | Description | |
|---|---|---|---|
| opts | array | ||
| Title | string | Chart title text | |
| Font | array | Font definition Name (string), Size (int), Bold (boolean) | |
AddCellTwoColorScale(rgb, rgb)
RGB values of initial color and last color. If colors are omitted default colors will be used
AddCellThreeColorScale(rgb, rgb, rgb)
RGB values of initial, mid point and last color. If colors are omitted default colors will be used
RangeFont(array opts)
Set the font for cell labels
| Option | Type | Description | |
|---|---|---|---|
| opts | array | ||
| Name | string | Font definition Name | |
| Size | int | Font size | |
| Color | rgb | Font color | |
SetXAxisLabels(array)
array of X Axis label strings
SetYAxisLabels
array of Y Axis label strings
AddRowData
array of row data. Dimension of this array has to be identical to the length of X Axis Label array
SetTable(array opts)
Data options for table with columns containing the data to be plotted
| Option | Type | Description | |
|---|---|---|---|
| opts | array | ||
| Dataview | string | Dataview and set name | |
| TableFields | arr | array of column names | |
| XAxisLabels | arr | optional display strings for TableFields | |
| YAxisLabelField | string | name of column to be used for Y labels strings | |
SetTable(array opts)
Data options for stacked table data to be plotted
| Option | Type | Description | |
|---|---|---|---|
| opts | array | ||
| Dataview | string | Dataview and set name | |
| XAxisLabelField | string | field for X Labels | |
| YAxisLabelField | string | field for Y labels | |
| DataField | string | data field | |
Examples
// create heat chart from data entered directly
// create heat chart from data entered directly
macro "SimpleHeatChart"
on error do
ShowMessage(GetLastError())
return()
end
def = CreateObject("Caliper.Defaults")
colors = def.Colors
Yellow = colors.Yellow
Green = colors.Green
Red = colors.Red
c = CreateObject("Caliper.HeatChart")
c.SetChartTitle({Text: "Sample Heat Chart", Font: {size: 18, bold: true}})
c.XLabelHeight = 150
c.YLabelWidth = 150
c.SetXAxisTitle({Text: "Time of Day", Font: {size: 14, bold: false}})
c.SetXAxisLabels({"00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00",
"08:00", "09:00", "10:00", "11:00", "12:00"})
c.SetYAxisTitle({Text: "Day of Week", Font: {size: 14, bold: false}})
c.SetYAxisLabels({"MON", "TUE", "WED", "THU", "FRI"})
c.AddRowData({10, 30, 50, 70, 90, 10, 20, 30, 50, 60, 30, 20, 50})
c.AddRowData({80, 20, 10, 50, 20, 50, 30, 40, 20, 40, 20, 30, 20})
c.AddRowData({60, 60, 30, 20, 0, 20, 30, 0, 20, 30, 20, 0, 0})
c.AddRowData({0, 10, 30, 40, 30, 30, 40, 50, 50, 30, 60, 70, 40})
c.AddRowData({50, 30, 20, 10, 40, 90, 50, 20, 10, 10, 80, 10, 20})
c.DataCellWidth = 75
c.AddCellThreeColorScale(Yellow, Green, Red)
c.HideCellLabels = false
c.RangeFont({Name: "Verdana", Size: 8, Color: colors.LightGray})
c.Show()
return(true)
endmacro
// create heatchart from a dataview with columns containing the data and rows for
// y-values (dates, location, etc)
// Open file SpeedDataForHeatChart.bin
macro "TableHeatChart"
on error do
ShowMessage(GetLastError())
return()
end
// build array of field names and display labels
for i = 1 to 77 do
arrFields = arrFields + {"Speed_" + i2s(i)}
arrDisplayLabels = arrDisplayLabels + {"S_" + i2s(i)}
end
c = CreateObject("Caliper.HeatChart")
c.SetChartTitle({Text: "Sample Heat Chart", Font: {size: 18, bold: true}})
c.XLabelHeight = 250
c.YLabelWidth = 250
c.SetXAxisTitle({Text: "Time of Day", Font: {size: 14, bold: false}})
c.SetYAxisTitle({Text: "Date", Font: {size: 14, bold: false}})
// set data for table options
c.Method = "Table"
data.DataView = GetView() + "|"
data.TableFields = arrFields
data.XAxisLabels = arrDisplayLabels
data.YAxisLabelField = "DateCollected"
c.SetTable(data)
c.DataCellWidth = 75
c.AddCellThreeColorScale()
c.Show()
return(true)
endmacro
// create a heatchart from stacked data.
// Open file SpeedStackedDataForHeatChart.bin
macro "StackedTableHeatChart"
on error do
ShowMessage(GetLastError())
return()
end
c = CreateObject("Caliper.HeatChart")
c.SetChartTitle({Text: "Sample Heat Chart", Font: {size: 18, bold: true}})
c.XLabelHeight = 150
c.YLabelWidth = 150
c.SetXAxisTitle({Text: "Time of Day", Font: {size: 14, bold: false}})
c.SetYAxisTitle({Text: "Day of Week", Font: {size: 14, bold: false}})
// set data for table options
c.Method = "StackedTable"
arr.DataView = GetView() + "|"
arr.XAxisLabelField = "Time"
arr.YAxisLabelField = "DateCollected"
arr.DataField = "Speed"
c.SetTable(arr)
c.DataCellWidth = 75
c.AddCellThreeColorScale()
c.Show()
return(true)
endmacro
See Also:
|
©2026 Caliper Corporation |