Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
- "elmType": "div",
- "style": {
- "display": "flex",
- "flex-direction": "column",
- "margin": "5px"
- },
- "children": [
- {
- "elmType": "div",
- "style": {
- "display": "flex",
- "flex-direction": "row",
- "justify-content": "space-between",
- "width": "100%",
- "margin-bottom": "3px"
- },
- "attributes": {
- "class": "ms-fontColor-ms-fontColor-themeDark ms-fontWeight-bold"
- },
- "children": [
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "1"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "2"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "3"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "4"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "5"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "6"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "7"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "8"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "9"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "10"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "11"
- },
- {
- "elmType": "span",
- "style": {
- "width": "100%",
- "text-align": "left"
- },
- "txtContent": "12"
- }
- ]
- },
- {
- "elmType": "div",
- "style": {
- "display": "flex",
- "width": "100%",
- "border": "2px solid",
- "height": "20px"
- },
- "attributes": {
- "class": "ms-fontColor-themePrimary"
- },
- "children": [
- {
- "elmType": "div",
- "style": {
- "position": "relative",
- "cursor": "pointer",
- "width": "=((Number(Date([$PrepEnd])) - Number(Date([$PrepStart]))) / (Number(Date('' + getYear([$PrepStart]) + '/12/31')) - Number(Date('' + getYear([$PrepStart]) + '/01/01')))) * 100 + '%'",
- "left": "=((Number(Date([$PrepStart])) - Number(Date('' + getYear([$PrepStart]) + '/01/01'))) / (Number(Date('' + getYear([$PrepStart]) + '/12/31')) - Number(Date('' + getYear([$PrepStart]) + '/01/01')))) * 100 + '%'"
- },
- "attributes": {
- "class": "ms-bgColor-themeLight ms-bgColor-themeTertiary--hover"
- },
- "customCardProps": {
- "directionalHint": "topCenter",
- "isBeakVisible": true,
- "openOnEvent": "hover",
- "formatter": {
- "elmType": "div",
- "style": {
- "display": "flex",
- "align-items": "center",
- "justify-content": "center",
- "width": "250px",
- "height": "30px",
- "margin": "10px",
- "font-weight": "bold"
- },
- "attributes": {
- "class": "ms-fontSize-l"
- },
- "children": [
- {
- "elmType": "div",
- "children": [
- {
- "elmType": "span",
- "txtContent": "[$PrepStart.displayValue]"
- },
- {
- "elmType": "span",
- "style": {
- "margin-left": "5px",
- "margin-right": "5px"
- },
- "txtContent": "-"
- },
- {
- "elmType": "span",
- "txtContent": "[$PrepEnd.displayValue]"
- }
- ]
- }
- ]
- }
- }
- },
- {
- "elmType": "div",
- "style": {
- "position": "relative",
- "cursor": "pointer",
- "width": "=((Number(Date([$End])) - Number(Date([$Start]))) / (Number(Date('' + getYear([$Start]) + '/12/31')) - Number(Date('' + getYear([$Start]) + '/01/01')))) * 100 + '%'",
- "left": "=(((Number(Date([$Start])) - Number(Date('' + getYear([$Start]) + '/01/01'))) / (Number(Date('' + getYear([$Start]) + '/12/31')) - Number(Date('' + getYear([$Start]) + '/01/01')))) * 100) - (((Number(Date([$PrepEnd])) - Number(Date([$PrepStart]))) / (Number(Date('' + getYear([$PrepStart]) + '/12/31')) - Number(Date('' + getYear([$PrepStart]) + '/01/01')))) * 100) + '%'"
- },
- "attributes": {
- "class": "ms-bgColor-themeSecondary ms-bgColor-themeTertiary--hover"
- },
- "customCardProps": {
- "directionalHint": "topCenter",
- "isBeakVisible": true,
- "openOnEvent": "hover",
- "formatter": {
- "elmType": "div",
- "style": {
- "display": "flex",
- "align-items": "center",
- "justify-content": "center",
- "width": "250px",
- "height": "30px",
- "margin": "10px",
- "font-weight": "bold"
- },
- "attributes": {
- "class": "ms-fontSize-l"
- },
- "children": [
- {
- "elmType": "div",
- "children": [
- {
- "elmType": "span",
- "txtContent": "[$Start.displayValue]"
- },
- {
- "elmType": "span",
- "style": {
- "margin-left": "5px",
- "margin-right": "5px"
- },
- "txtContent": "-"
- },
- {
- "elmType": "span",
- "txtContent": "[$End.displayValue]"
- }
- ]
- }
- ]
- }
- }
- }
- ]
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement