Skip to content

Instantly share code, notes, and snippets.

Sparkline Line =
// Static line color - use %23 instead of # for Firefox compatibility
VAR LineColor = "%2301B8AA"
// "Date" field used in this example along the X axis
VAR XMinDate = MIN('Table'[Date])
VAR XMaxDate = MAX('Table'[Date])
// Obtain overall min and overall max measure values when evaluated for each date
@halhen
halhen / elevation.R
Last active November 4, 2020 16:11
# Download elevation tif from eg http://www.eea.europa.eu/data-and-maps/data/digital-elevation-model-of-europe
# First, convert elevation tif to a space delimited xyz (lng lat elevation) file
# $ gdal_translate -of XYZ elevation3x3.tif /tmp/file.xyz
df <- read_delim('/tmp/file.xyz', delim=' ', col_names=FALSE)
df %>%
mutate(X3 = na_if(X3, 0)) %>%
ggplot(aes(X1, -X2 + 20 * X3/max(X3, na.rm=TRUE), group=X2)) +
geom_line(size=0.05) +
@ColinEberhardt
ColinEberhardt / .block
Last active May 28, 2024 21:48
Health and Wealth of Nations - Bubble Chart
license: mit
@deldersveld
deldersveld / PowerBI-CustomHTMLTooltip
Last active August 7, 2024 07:01
Use this code in a Power BI calculated column to enhance the default tooltip in the ArcGIS Maps for Power BI visual
HTML Tooltip = "<img src='https://www.blue-granite.com/hs-fs/hub/257922/file-2333776730-png/IMG_2015/Blue-Granite-Logo.png' width='200px' /><br>" &
"<br>Reported: <em>" & Table1[OutageReported] & "</em>" &
"<br>Restoration Est: <em>" & Table1[RestorationEstimate] & "</em>" &
"<br><br><table bordercolor='#FFFFFF' cellspacing='8'><tr>" &
"<th style='color:#01B8AA;'>Customers Affected</th><th style='color:#01B8AA;'>Status</th></tr><tr>" &
"<td style='color:#" & IF(Table1[Number of Customers Affected] > 50,"DD0000","FFFFFF") & ";'>" & Table1[Number of Customers Affected] & "</td>" &
"<td>" & Table1[Status] & "</td></tr></table>"