How can i set labels on periods in the ganttResource anychart 8.1.0 - gantt-chart

Hi i want to put a label on a period
If i use version 7.7.0 I can achive it using it like this:
http://jsfiddle.net/NightKaos/nd5nwb1s/3/
{
"id": "1",
"name": "Phase 1 - Strategic Plan",
"periods": [
{
"id": "1_1",
"start": 1171468800000,
"end": 1171906900000,
"fill": "#00FF33",
"progressValue": "25%",
'label': {
"value": 'Custom Label ',
'anchor': 'center',
'position': 'center',
'hAlign': 'center'
},
}
How can i do it on version 8.1.0?
I can access task name but not periods data.
I have a sample in here:
https://jsfiddle.net/NightKaos/zffqhz74/2/

You can set the label text and properties from the data in 8.1.0 just as you did in 7.7.0
Please check the following example
// set label object to configure labels in periods
var data = [
{
"id": "1",
"name": "Period 1",
"periods": [
{
"id": "1_1",
"start": 1171468800000,
"end": 1171987200000,
"label" : {
"format":"Label 1 in the center",
"anchor": "center",
"position": "center"
}
}]
},
{
"id": "2",
"name": "Period 2",
"periods": [
{
"id": "1_2",
"start": 1171668800000,
"end": 1171887200000,
"label" : {
"format":"Label 2 in the center",
"anchor": "center",
"position": "center"
}
}]
}
];
anychart.onDocumentReady(function () {
var treeData = anychart.data.tree(data, "as-table");
chart = anychart.ganttResource();
chart.container("container");
chart.bounds(0, 0, "100%", "100%");
chart.data(treeData);
chart.splitterPosition(170);
var dataGrid = chart.dataGrid();
// settings for first column
dataGrid.column(0).width(30).title().text("#");
// settings for the second column
dataGrid.column(1).width(140).format(function (item) {
return item.get("name");
}).title().text("Person");
//enable period labels
chart.getTimeline().baseLabels(true);
chart.draw();
chart.fitAll();
});
html, body, #container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
<script src="https://cdn.anychart.com/releases/8.1.0/js/anychart-bundle.min.js"></script>
<link rel="stylesheet" href="https://cdn.anychart.com/releases/8.1.0/css/anychart-ui.min.css" />
<div id="container"></div>

Related

In Apple News Format, how do I replace an image all at once rather than have it revealed via scrolling?

First time poster, long-time reader!
I am writing the JSON for an Apple News story. I have three consecutive full-screen fill images. They are all set to "attachment":"fixed". The transition from one image to another, when scrolling, is to reveal the next image continuously. I would like the "incoming" image to replace the prior image wholesale -- it just appears after someone scrolls to the bottom of the prior image. Hoping that makes sense, since I can't show the actual Apple News preview. I don't want to use an animation, since that only appears once; I want the same behavior when people scroll backwards.
Here's what I have now ... and the scrolling reveal IS what I expected. I want the very different behavior detailed above!
"components": [
{
"role": "header",
"style": "leadVideoStyle",
"layout": {
"ignoreDocumentMargin": true,
"minimumHeight": "125vh"
},
"components": [
{
"role": "container",
"anchor": {
"targetAnchorPosition": "top"
},
"style": "scrimBackgroundStyle",
"layout": {
"ignoreDocumentMargin": true
},
"components": [
{
"role": "title",
"layout": "titleLayout",
"text": "some text",
"textStyle": "titleStyle",
"format": "html"
},
{
"role": "intro",
"layout": "introLayout",
"text": "some text,
"textStyle": "introStyle"
}
]
}
]
},
{
"role": "section",
"layout": {
"ignoreDocumentMargin": true,
"minimumHeight": "200vh"
},
"style": "leadPhotoStyle1"
},
{
"role": "section",
"layout": {
"ignoreDocumentMargin": true,
"minimumHeight": "200vh"
},
"style": "leadPhotoStyle2"
}
],
"leadVideoStyle": {
"fill": {
"type": "video",
"URL": "URL here",
"stillURL": "bundle URL",
"fillMode": "cover",
"verticalAlignment": "top",
"attachment": "fixed"
}
},
"leadPhotoStyle1": {
"fill": {
"type": "image",
"URL": "URL here",
"fillMode": "cover",
"verticalAlignment": "top",
"attachment": "fixed"
}
},
"leadPhotoStyle2": {
"fill": {
"type": "image",
"URL": "URL here",
"fillMode": "cover",
"verticalAlignment": "top",
"attachment": "fixed"
}

Thumbnail View on Sharepoint 2016 Document Library

is it possible to change view from list to thumbnail on document library sharepoint 2016?
I've searched for documentation on google, youtube, microsoft still can't find the answer, please help. Currently the display of the user is still a list
You could achieve this by using view formatting.
Make sure your library contains 'Type', 'Create by' and 'Type' column.
1.View -> formatting current view -> Prase following code.
enter image description here
2.Choose layout to 'Gallery'-> save.
code template:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json Jump ",
"tileProps": {
"hideSelection": true,
"height": "280",
"width": "300",
"formatter": {
"elmType": "div",
"style": {
"align-items": "stretch",
"margin": "3px 2px",
"background-color": "#fbfbfb",
"height": "380px",
"overflow": "inherit",
"border-radius": "2px",
"box-shadow": "0px 1.6px 3.6px 0 #00000024, 0px 0.3px 0.9px 0 #00000024"
},
"children": [
{
"elmType": "div",
"style": {
"display": "flex",
"flex-wrap": "wrap",
"position": "relative",
"padding-bottom": "10px",
"width": "100%"
},
"children": [
{
"elmType": "div",
"style": {
"margin-top": "0px",
"height": "200px",
"display": "block",
"align-items": "center",
"justify-content": "center",
"position": "relative",
"border-bottom": "1px solid #EEE",
"overflow": "hidden",
"border-radius": "2px 2px 0 0"
},
"children": [
{
"elmType": "button",
"style": {
"position": "absolute",
"height": "100%",
"width": "100%",
"opacity": "0",
"cursor": "pointer"
},
"customRowAction": {
"action": "defaultClick"
}
},
{
"elmType": "div",
"style": {
"width": "=if([$File_x0020_Type] == '', '100px', '100%')",
"height": "=if([$File_x0020_Type] == '', '100px', '100%')",
"oveflow": "=if([$File_x0020_Type] == '', 'auto', 'hidden')",
"text-align": "center",
"overflow": "hidden"
},
"children": [
{
"elmType": "img",
"style": {
"height": "=if([$File_x0020_Type] == '', '100%', '0'"
},
"attributes": {
"src": "=if([$File_x0020_Type] == '', 'https://spoprod-a.akamaihd.net/files/fabric/office-ui-fabric-react-assets/foldericons-fluent/folder-large_frontplate_nopreview.svg Jump ', '')"
}
},
{
"elmType": "img",
"style": {
"display": "=if([$File_x0020_Type] == '', 'none', '')"
},
"attributes": {
"src": "#thumbnail.383x383"
}
}
]
}
]
},
{
"elmType": "div",
"style": {
"margin": "25px 0 0 0",
"position": "absolute",
"top": "153px",
"width": "100%",
"color": "#333333"
},
"attributes": {
"class": "ms-fontSize-14 ms-fontWeight-semibold"
},
"children": [
{
"elmType": "img",
"attributes": {
"src": "=if([$File_x0020_Type] == 'docx', 'https://spoprod-a.akamaihd.net/files/fabric/assets/item-types-fluent/20/docx.svg?v6 Jump ', if([$File_x0020_Type] == 'xlsx', 'https://spoprod-a.akamaihd.net/files/fabric/assets/item-types-fluent/20/xlsx.svg?v6 Jump ', if([$File_x0020_Type] == 'pptx', 'https://spoprod-a.akamaihd.net/files/fabric/assets/item-types-fluent/20/pptx.svg?v6 Jump ', if([$File_x0020_Type] == 'pdf', 'https://spoprod-a.akamaihd.net/files/fabric/assets/item-types-fluent/20/pdf.svg?v6 Jump ', if([$File_x0020_Type] == 'jpg' || [$File_x0020_Type] == 'png' || [$File_x0020_Type] == 'gif','https://spoprod-a.akamaihd.net/files/fabric/assets/item-types-fluent/20/photo.svg?v6 Jump ', if([$File_x0020_Type] == 'mp4' || [$File_x0020_Type] == 'avi' || [$File_x0020_Type] == 'mov', 'https://spoprod-a.akamaihd.net/files/fabric/assets/item-types-fluent/20/video.svg?v6 Jump ', if([$File_x0020_Type] == 'zip', 'https://spoprod-a.akamaihd.net/files/fabric/assets/item-types-fluent/20/zip.svg?v6 Jump ','Unknown')))))))"
},
"style": {
"flex": "none",
"line-height": "100%",
"font-weight": "normal",
"font-size": "2rem",
"margin": "5px 5px 5px 10px",
"height": "25px"
}
},
{
"elmType": "div",
"txtContent": "[$FileLeafRef]",
"style": {
"padding": "0 0 0 16px"
}
},
{
"elmType": "div",
"txtContent": "='edited by ' + [$Editor.title]",
"style": {
"padding": "0 0 0 16px"
}
}
]
}
]
}
]
}
}
}

MS Lists Lookup column not found in data object

I have two lists A and B. I've created a lookup column on B to get data from A (item # and item address). I want to customize the view when opening an item on list B. But I can't find a way to make the fields from A visible on B. I get
Failure: TEST_x0020_SHIPPING_x0020_ADDRES1 was not found on the data object.
I checked the name of the field and it's correct and contains data. Please check the attached image. Is there a way to get that information on that view?
Note: if I disable debug it shows nothing.
Thanks in advance!
JSONERROR
Update: The code I'm using on the Header comes from the MS official site https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/list-form-configuration
{
"debugMode": false,
"elmType": "div",
"attributes": {
"class": "ms-borderColor-neutralTertiary"
},
"style": {
"width": "99%",
"border-top-width": "0px",
"border-bottom-width": "1px",
"border-left-width": "0px",
"border-right-width": "0px",
"border-style": "solid",
"margin-bottom": "16px"
},
"children": [
{
"elmType": "div",
"style": {
"display": "flex",
"box-sizing": "border-box",
"align-items": "center"
},
"children": [
{
"elmType": "div",
"attributes": {
"iconName": "Devices3",
"class": "ms-fontSize-42 ms-fontWeight-regular ms-fontColor-themePrimary",
"title": "Details"
},
"style": {
"flex": "none",
"padding": "0px",
"padding-left": "0px",
"height": "36px"
}
}
]
},
{
"elmType": "div",
"attributes": {
"class": "ms-fontColor-neutralSecondary ms-fontWeight-bold ms-fontSize-24"
},
"style": {
"box-sizing": "border-box",
"width": "100%",
"text-align": "left",
"padding": "21px 12px",
"overflow": "hidden"
},
"children": [
{
"elmType": "div",
"txtContent": "='Store ' + [$TEST_x0020_SHIPPING_x0020_ADDRES1]"
}
]
}
]
}

Update row select editparams on row, based on dataedit trigger from another select

Looking to update a rows defined select values initialized editParams values to an alternate set based on the selected value of another cell. In the sample code you'll see if a user selects a module I am trying to update the available permissions to configure on the selected module. Any help is much appreciated.
I looked at the objects in console log and do not see any way to do this.
`function rolesTable(rolesTableName) {
var rolesTable;
setTimeout(function() {
rolesTable = new Tabulator(rolesTableName, {
data:orgRolesData,
height:"311px",
layout:"fitColumns",
placeholder:"No Data Set",
addRowPos:"top",
cellEdited:function(cell){
var data = cell.getData();
var row = cell.getRow();
if (data['module'] == "Organization") {
/*
How to set the actions select values for the row
?? row.C
*/
}
var column = cell.getColumn();
console.log(row);
},
columns:[
{title:"Name", field:"name", sorter:"string", width:200, editor:"input"},
{title:"Module", field:"module", sorter:"string", editor:"select", editorParams:{values:{"Organization":"Organization", "User":"User", "Event":"Event", "Asset":"Asset"}} },
{title:"Action", field:"action", sorter:"string", editor:"select", editorParams:{values:{"A":"A", "B":"B", "C":"C"}} },
{title:"Create", field:"create", align:"center", formatter:"tickCross", sorter:"boolean", editor:true},
{title:"Read", field:"read", align:"center", formatter:"tickCross", sorter:"boolean", editor:true},
{title:"Update", field:"update", align:"center", formatter:"tickCross", sorter:"boolean", editor:false},
{title:"Delete", field:"delete", align:"center", formatter:"tickCross", sorter:"boolean", editor:false},
],
initialSort:[
{column:"name", dir:"asc"}, //sort by this first
{column:"module", dir:"desc"}, //then sort by this second
]
});
rolesTable.redraw();
}, 800);
}`
const tabledata = [{
dep: "A",
name: "Oli Bob",
score: 100
}];
const orignalColumns = [{
title: "Name",
field: "name",
sorter: "string",
width: 200,
editor: "input"
},
{
title: "Module",
field: "module",
sorter: "string",
editor: "select",
editorParams: {
values: {
"Organization": "Organization",
"User": "User",
"Event": "Event",
"Asset": "Asset"
}
}
},
{
title: "Action",
field: "action",
sorter: "string",
editor: "select",
editorParams: {
values: {
"A": "A",
"B": "B",
"C": "C"
}
}
},
{
title: "Create",
field: "create",
align: "center",
formatter: "tickCross",
sorter: "boolean",
editor: true
},
{
title: "Read",
field: "read",
align: "center",
formatter: "tickCross",
sorter: "boolean",
editor: true
},
{
title: "Update",
field: "update",
align: "center",
formatter: "tickCross",
sorter: "boolean",
editor: false
},
{
title: "Delete",
field: "delete",
align: "center",
formatter: "tickCross",
sorter: "boolean",
editor: false
},
];
const modifieldColumns = [{
title: "Name",
field: "name",
sorter: "string",
width: 200,
editor: "input"
},
{
title: "Module",
field: "module",
sorter: "string",
editor: "select",
editorParams: {
values: {
"Organization": "Organization"
}
}
},
{
title: "Action",
field: "action",
sorter: "string",
editor: "select",
editorParams: {
values: {
"A": "A",
"B": "B",
"C": "C"
}
}
},
{
title: "Create",
field: "create",
align: "center",
formatter: "tickCross",
sorter: "boolean",
editor: true
},
{
title: "Read",
field: "read",
align: "center",
formatter: "tickCross",
sorter: "boolean",
editor: true
},
{
title: "Update",
field: "update",
align: "center",
formatter: "tickCross",
sorter: "boolean",
editor: false
},
{
title: "Delete",
field: "delete",
align: "center",
formatter: "tickCross",
sorter: "boolean",
editor: false
},
];
const table = new Tabulator("#example-table", {
data: tabledata,
cellEdited: function(cell) {
const data = cell.getData();
if (data['module'] === "Organization") {
table.setColumns(modifieldColumns);
}
},
columns: orignalColumns
});
<head>
<link href="https://unpkg.com/tabulator-tables#4.3.0/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables#4.3.0/dist/js/tabulator.min.js"></script>
</head>
<body>
<div id="example-table"></div>
</body>

Crosshair-x won't display on line chart

I am having an issue with a line chart on my site. Everything works fine about it except no matter what I try, I cannot get the crosshair-x value/scale to show up. http://gyazo.com/42a34d0fed9c2912bf7ed40eb0c55144 Both are set to "visible": true. My JSON code is as follows:
var myChart = {
"type": "line",
"background-color": "transparent",
"utc": true,
"title": {
"y": "0px",
"text": '#myClasses.STARTDATETIME.ToString("MM/d/yyyy (h:mm tt)")',
"background-color": "transparent",
"font-size": "16px",
"font-color": "#666",
"font-weight": "bold",
"letter-spacing": "0.1225em",
"height": "25px"
},
"plotarea": {
"margin":"10% 8% 14% 12%",
"background-color":"#666"
},
"legend": {
"visible": false,
},
"scale-x": {
"min-value": myEpoch,
"shadow": 0,
"step": #ViewBag.TotalTime,
"line-color": "#fff",
"tick": {
"line-color": "#f6f7f8"
},
"guide": {
"line-color": "#f6f7f8",
"visible": true
},
"item": {
"font-color": "#666"
},
"transform": {
"type": "date",
"all": "%D,%d %M<br />%h:%i %A",
"item": {
"visible": false
}
},
"label": {
"visible": false,
"font-color": "#666"
},
"minor-ticks": 0
},
"scale-y": {
"values": "25:200:25",
"line-color": "#fff",
"shadow": 0,
"tick": {
"line-color": "#f6f7f8"
},
"guide": {
"visible": false
},
"item": {
"font-color": "#666"
},
"label": {
"text": "Heart Rate (BPM)",
"font-color": "#666"
},
"minor-ticks": 0,
"thousands-separator": ",",
"markers": [
{
"type": "area",
"range": [25, 60],
"backgroundColor": "#585857",
"alpha": 1
},
{
"type": "area",
"range": [60, 95],
"backgroundColor": "#6FCBDC",
"alpha": 1
},
{
"type": "area",
"range": [95, 130],
"backgroundColor": "#8BC540",
"alpha": 1
},
{
"type": "area",
"range": [130, 165],
"backgroundColor": "#F38220",
"alpha": 1
},
{
"type": "area",
"range": [165, 200],
"backgroundColor": "#EB2026",
"alpha": 1
}
]
},
"tooltip": {
"font-color": "#666",
"visible": false
},
"chart": {
"marginRight": 30,
"marginLeft": 70
},
"plot": {
"tooltip-text": "%t bpm: %v",
"shadow": 0,
"line-width": "3px",
"marker": {
"type": "circle",
"size": 2
},
"hover-marker": {
"type": "circle",
"size": 4,
"border-width": "1px"
}
},
"series": [
{
"values": [88,96,93,88,88,86,89,120,144,153,156,132,113,145,138,152,135,155,164,165,147,143,152,140,153,138,116,125,131,132,134,124,111,136,167,171,165,168,139,129,138,130,140,141],
"text": "",
"line-color": "#ffffff",
"marker": {
"background-color": "#ffffff",
"border-width": 1,
"shadow": 0,
"border-color": "#ffffff",
"visible": true
},
"palette": 0
}
],
"crosshair-x": {
"line-color": "#f6f7f8",
"value-label": {
"border-radius": "5px",
"border-width": "1px",
"border-color": "#f6f7f8",
"padding": "0px 10px 0px 5px",
"font-weight": "bold",
"font-color": "#fff",
"background-color": "#666",
"visible": true
},
"scale-label": {
"font-color": "#fff",
"background-color": "#666",
"border-radius": "5px",
"border-width": "1px",
"border-color": "#f6f7f8",
"padding": "0px 10px 0px 5px",
"visible": true
}
}
};
Is there anything obvious that I'm missing that may be overruling those being set to visible?
Thanks in advance for your help!
Which version of ZingChart are you using? Does this occur in all browsers? Are you getting any console errors? I've taken your code and put it into our demo tool, and the crosshair seems to work. Take a look here.
You can try adding the following to the <head> element of your application:
<style title="zingchart"></style>
This forces ZingChart to inject its CSS into that element, preventing certain types of conflicts that can occur from time to time, but I'm not 100% sure that this is the issue.
I'm on the ZingChart support team, so I'd love to help, but I can't reproduce the issue on my end.

Resources