Plotting Cheat Sheet

note

Some plotting methods are only supported by Deephaven Classic, and are coming soon to the web platform.

XY Series#

plot("SeriesName", source, "xCol", "yCol") //table source
plot("SeriesName", [x],[y]) //array source
plot("SeriesName", function) //function source

Category (including Bar Charts)#

catPlot("SeriesName", source, "CategoryCol", "ValueCol") //table source
catPlot("SeriesName", [category], [values]) //array source

Histogram#

histPlot("seriesName", source, "ValueCol", nbins) //table source
histPlot("SeriesName", [x], nbins) //array source

Category Histogram#

catHistPlot("seriesName", source, "ValueCol") //table source
catHistPlot("SeriesName", [Values]) //array source

Pie#

piePlot("SeriesName", source, "CategoryCol", "ValueCol") //table source
piePlot("SeriesName", [category], [values]") //array source

Open, High, Low, and Close (OHLC)#

ohlcPlot("SeriesName", source, "Time", "Open", "High", "Low", "Close") //table source
ohlcPlot("SeriesName",[Time], [Open], [High], [Low], [Close]) //array source

ErrorBar Charts#

errorBarX("SeriesName", source, "x", "y", "xLow", "xHigh") //table source
errorBarX("SeriesName", [x], [y], [xLow], [xHigh]) //array source
errorBarY("SeriesName", source, "x", "y", "yLow", "yHigh") //table source
errorBarY("SeriesName", [x], [y], [yLow], [yHigh]) //array source
errorBarXY("SeriesName",source,"x","xLow","xHigh","y","yLow","yHigh") //table source
errorBarXY("SeriesName", [x], [xLow], [xHigh], [y], [yLow], [yHigh]) //array source
catErrorBar("SeriesName", source, "x", "y", "yLow", "yHigh") //table source
catErrorBar("SeriesName", [x],[y],[yLow],[yHigh]) //array source

Scatter Plot Matrix#

scatterPlotMatrix(table, "series1", "series2", …)

Multiple Charts in a Figure#

figure(int Rows, int Columns).newChart(r,c).plot…
.rowSpan(r) // span multiple rows
.colSpan(c) // span multiple columns
.span(r,c) // span multiple rows and columns

plotBy, catPlotBy, and ohlcPlotBy#

plotBy("Series1", source, "xCol", "yCol", "groupByCol")
catPlotBy("SeriesName", source, "CategoryCol", "ValueCol", "groupByCol")
ohlcPlotBy("SeriesName", source, "Time", "Open", "High", "Low", "Close", "groupByCol")

OneClick#

oneClick(source, "ColName1", "ColName2", …)

Formatting#

Plot Styles - Applies to XY Series and Category Charts only. Options: Bar, Stacked_Bar, Line, Area, Stacked_Area, Scatter, Step

plot(series, t, "x", "y")
plotStyle("optionName")

Time Formatting#

xFormatPattern("yyyy-MM-dd") // e.g., 2017-03-08
xFormatPattern("HH:mm") // e.g., 14:45
xFormatPattern("hh:mm a") // e.g., 02:45 p.m.
xFormatPattern("HH:mm:ss") // e.g., 14:45:59
xFormatPattern("yyyy-MM-dd'T'HH:mm:ss") // e.g., 2017-03-08T14:45:59

Decimal Formatting#

yFormatPattern("###,###.00") // e.g., 123,456.78
yFormatPattern("\$###,###.00") // e.g., $123,456.78
yFormatPattern("\$###,###.00 Million") // e.g., $123,456 Million
yFormatPattern("###.00%") // e.g., 100.11%
yFormatPattern("##0.00E00") // e.g., 321.34E8

Themes#

figure().theme("Dark")

Titles/Labels#

figureTitle("Title")
chartTitle("Title")
xLabel("Label")
yLabel("Label")

Axis Ranges#

xRange(value, value)
xMin(value)
yMax(value)
// Shared axis
twinX()
twinY()

Ticks - Angle, Gap, Visibility#

xTickLabelAngle(45.0)
xTicks(10)
yMinorTicks(5)
xTicksVisible(false)
yMinorTicksVisible(false)

Font Formatting#

.fontObject("FontFamily", "Style", size)
figureTitleFont("Arial Black", "p", 32)
chartTitleFont("Arial", "Bold", 24)
xLabelFont("SansSerif", "P", 10)
legendFont("Tahoma", "BI", 9)

Line Formatting#

linesVisible(true)
lineStyle(lineStyle(width))
lineStyle(lineStyle([dashPattern])) // dashLength, gapLength
lineStyle(lineStyle(width,[dashPattern]))
lineStyle(lineStyle(width,"endStyle","joinStyle",[dashPattern]))

Point Formatting#

pointsVisible(true)
pointSize(2)
pointSize(0.5)
pointSize([1,2,3]) // array-based sizing
pointSize(t,"Size") // table columns sizing

Color Formatting#

RGB, RGBA, HSL, HSLA, Hexadecimal or HTML Color Name

pointColor(colorRGB(153,204,255))
lineColor(colorHSL(0,100,50))
chartTitleColor("#9F9F9F")
chartTitleColor("BLACK")

Plot Orientation#

plotOrientation("horizontal")

Legend#

legendVisible(false)