// 主題是qliksense 2018年2月版提出,4月版正式實施,其實就是去修改sense默認的.json文件和.css文件 { // 定義自定義主題是否從默認主題(Sense Classic)繼承樣式屬性。JSON文件中定義的屬性會覆蓋繼承的屬性。默認ture "_inherit": false, //(可選) 可以在JSON文件中引用的變量。 "_variables": { "@default": "#555555", "@dark": "#333333", "@light": "#eeeeee", "@H1": "24px", "@H2": "18px", "@H3": "14px", "@H4": "13px", "@H5": "12px", "@font-normal": "12px" }, // (可選) 引用將在應用主題時插入的自定義樣式表。 "customStyles": [{ "cssRef": "theme.css", "classRef": "my-theme" }], // 字體顏色。可以通過在任何支持顏色的級別上定義顏色屬性來覆蓋此設置 "color": "@default", // 字體大小。可以通過在支持fontSize的任何級別上定義fontSize屬性來覆蓋此設置 "fontSize": "@font-normal", // 圖表的背景顏色。可以通過在圖表類型級別定義背景顏色屬性來覆蓋此設置。 "backgroundColor": "@light", // 對象樣式。 "object": { // 標題屬性。可以通過在圖表類型級別定義title屬性來覆蓋此設置。 "title": { // 主標題 "main": { "color": "@default", "fontSize": "@font-normal" }, // 副標題 "subTitle": { "color": "@default", "fontSize": "@font-normal" }, // 腳標題 "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, // 標簽屬性。可以通過在圖表類型級別為具有標簽的圖表定義label屬性來覆蓋此設置。 // 以下圖表類型支持標簽屬性: // barChart 條形圖 (label.name.color; label.value.fontSize) // gauge 儀表盤 (label.name.color;) // histogram 直方圖 (label.name.color; label.value.fontSize) // lineChart 線型圖 (label.name.color; label.value.fontSize) // pieChart 餅圖 (label.name.color; label.name.fontSize;label.value.fontSize) //scatterPlot 散點圖 (label.name.color; label.value.fontSize) // waterfallChart 瀑布圖 (label.value.fontSize) "label": { // 標簽名稱屬性。 "name": { "color": "@default", "fontSize": "10px" }, // 標簽值屬性。 "value": { "color": "@default", "fontSize": "10px" } }, // 軸屬性。通過在圖表類型級別上為具有軸的圖表(條形圖,箱形圖,組合圖,分布圖,儀表,直方圖,折線圖,散點圖和瀑布圖)定義軸屬性,可以覆蓋此設置。 // 對於餅圖,可以覆蓋axis.title並用於為尺寸標簽設置樣式。 "axis": { // 軸標題屬性。 "title": { "fontSize": "@font-normal", "color": "@default" }, // 軸標簽屬性。 "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, // 軸線屬性。 "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, // 網格屬性。無法在圖表類型級別覆蓋此設置。 "grid": { // 線屬性 "line": { // 高對比度 "highContrast": { "color": "@default" }, // 主要 "major": { "color": "@default" }, // 次要 "minor": { "color": "@default" } } }, // 參考線屬性。無法在圖表類型級別覆蓋此設置。 "referenceLine": { // 標簽屬性 "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, // 超出范圍的屬性。 "outOfBounds": { "color": "@default", "backgroundColor": "@default", "fontSize": "@H6" } }, // 圖例 通過在圖表類型級別為帶有圖例的圖表(條形圖,組合圖,折線圖,餅圖,散點圖,樹圖,瀑布圖)定義圖例屬性,可以覆蓋此設置。 "legend": { // 圖例標題 "title": { "color": "@default", "fontSize": "@font-normal" }, // 圖例標簽 "label": { "color": "@default", "fontSize": "@font-normal" } }, // 圖表類型 這些是可以存在於對象結構中的常見圖表類型屬性。為每個圖表列出的屬性是特定的 // 大多數全局對象屬性也可以在圖表類型級別上定義。如果完成,則覆蓋全局對象級別上設置的屬性。 // 條形圖 "barChart": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "legend": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "fontSize": "@font-normal", "color": "@default" } }, "label": { "value": { "color": "@default", "fontSize": "@font-normal" } }, // 超出范圍的屬性。 "outOfRange": { "color": "@default" } }, // 箱型圖 "boxPlot": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "box": { "whisker": { "stroke": "@default" }, "line": { "stroke": "@default" }, "box": { "fill": "@default", "stroke": "@default" } } }, // 組合圖 "comboChart": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "legend": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "fontSize": "@font-normal", "color": "@default" } } }, // 分布圖 "distributionPlot": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "box": { "fill": "@default" } }, // 篩選器 "filterpane": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } } }, // 儀表盤 "gauge": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "label": { "value": { "color": "@default" } } }, // 直方圖 "histogram": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "label": { "value": { "color": "@default", "fontSize": "40px" } } }, // 關鍵業績指標 "kpi": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } } }, // 線型圖 "lineChart": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "legend": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "fontSize": "@font-normal", "color": "@default" } }, "outOfRange": { "color": "@default" }, "label": { "value": { "color": "@dark", "fontSize": "@font-normal" } } }, // 列表框 "listBox": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" } }, "content": { "color": "@default", "fontSize": "@font-normal" } }, // 地圖 "mapChart": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } } }, // 餅圖 "pieChart": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "color": "@default", "fontSize": "@font-normal" } }, "legend": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "fontSize": "@font-normal", "color": "@default" } }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" }, "value": { "fontSize": "@font-normal" } } }, //數據透視表 "pivotTable": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "header": { "fontSize": "@font-normal", "color": "@default" }, "content": { "fontSize": "@font-normal", "color": "@default" } }, // 散點圖 "scatterPlot": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "legend": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "fontSize": "@font-normal", "color": "@default" } }, "label": { "value": { "color": "@default", "fontSize": "@font-normal" } } }, // 垂直表 "straightTable": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "header": { "fontSize": "@font-normal", "color": "@default" }, "content": { "fontSize": "@font-normal", "color": "@default" } }, // 文字圖片 "textImage": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } } }, // 樹形圖 "treemap": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "legend": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "fontSize": "@font-normal", "color": "@default" } }, "branch": { "backgroundColor": "@default", "label": { "color": "@light", "fontSize": "@font-normal" } }, "leaf": { "label": { "fontSize": "@font-normal" } } }, // 瀑布圖 "waterfallChart": { "backgroundColor": "@light", "title": { "main": { "color": "@default", "fontSize": "@font-normal" }, "subTitle": { "color": "@default", "fontSize": "@font-normal" }, "footer": { "color": "@default", "fontSize": "@font-normal", "backgroundColor": "@light" } }, "axis": { "title": { "fontSize": "@font-normal", "color": "@default" }, "label": { "name": { "color": "@default", "fontSize": "@font-normal" } }, "line": { "major": { "color": "@default" }, "minor": { "color": "@default" } } }, "legend": { "label": { "fontSize": "@font-normal", "color": "@default" } }, "label": { "value": { "fontSize": "@font-normal" } }, "value": { "color": { "default": "@default", "dark": "@dark", "light": "@light" } }, // 形狀 "shape": { "positiveValue": { "fill": "white" }, "negativeValue": { "fill": "#ccccc" }, "subtotal": { "fill": "#000000" }, "bridge": { "stroke": "#333333" } } } }, // 數據顏色屬性。 "dataColors": { // 原色 "primaryColor": "blue", // 其他色 "othersColor": "grey", // 錯誤顏色 "errorColor": "red", // 空值顏色 "nullColor": "yellow" }, // 調色板 按維度取色范圍 "palettes": { // 數據調色板的屬性。這些用於屬性面板中的尺寸顏色。 "data": [{ // 可選的。調色板的名稱。 "name": "First data palette", // 顯示UI中調色板名稱 "translation": "12 colors", // 調色板的標識符。必須在系統中是唯一的。 "propertyValue": "data-palette-1", // 調色板的類型。pyramid金字塔 row 行 "type": "pyramid", // 調色板中使用的所有顏色的定義。從上到下,從左到右縮放。 "scale": [ ["#4477aa"], ["#4477aa", "#cc6677"], ["#4477aa", "#ddcc77", "#cc6677"], ["#4477aa", "#117733", "#ddcc77", "#cc6677"], ["#332288", "#88ccee", "#117733", "#ddcc77", "#cc6677"], ["#332288", "#88ccee", "#117733", "#ddcc77", "#cc6677", "#aa4499"], ["#332288", "#44aa99", "#88ccee", "#117733", "#ddcc77", "#cc6677", "#aa4499"], ["#332288", "#44aa99", "#88ccee", "#117733", "#999933", "#ddcc77", "#cc6677", "#aa4499"], ["#332288", "#44aa99", "#88ccee", "#117733", "#999933", "#ddcc77", "#cc6677", "#882255", "#aa4499"], ["#332288", "#44aa99", "#88ccee", "#117733", "#999933", "#ddcc77", "#661100", "#cc6677", "#882255", "#aa4499"], ["#332288", "#6699cc", "#44aa99", "#88ccee", "#117733", "#999933", "#ddcc77", "#661100", "#cc6677", "#882255", "#aa4499"], ["#332288", "#6699cc", "#88ccee", "#44aa99", "#117733", "#999933", "#ddcc77", "#661100", "#cc6677", "#aa4466", "#882255", "#aa4499"] ] }, { "name": "Second data palette", "translation": "4 Colors", "propertyValue": "data-palette-2", "type": "row", "scale": [ "#ff00ff", "#00ff00", "#0000ff", "#000000" ] } ], // UI調色板的屬性。您可以定義幾個調色板,但是在顏色選擇器中使用ui中定義的第一個調色板,例如,當用單色時/維度/度量/按表達式。 "ui": [{ // 調色板名稱 "name": "Palette", // UI調色板中使用的顏色。應始終定義唯一的顏色。 "colors": [ "#cccccc", "#aaaaaa", "#111111", "#999999", "#acacac", "#dddddd", "#eeeeee", "#ffffff", "#000000" ] }] }, // 按度量取色范圍 這些是常見的配色方案屬性。在“屬性”面板中,縮放用於“測量顏色”。 "scales": [ { // 配色方案名稱(自定義順序漸變) "name": "Custom Sequential Gradient", // 顯示UI中顏色方案的名稱 "translation": "Custom Sequential Gradient", // 配色方案的屬性值 sg(Sequential Gradient 順序漸變)sc(Sequential Class順序類)dg(Diverging gradient 發散漸變)dc(Diverging Classes 發散類) "propertyValue": "sg", // 配色方案的類型。gradient漸變 classes類 "type": "gradient", // 顏色方案中包含的顏色,從左到右縮放。 "scale": ["#1A2980", "#26D0CE"] }, { "name": "Custom Sequential Classes", "translation": "Custom Sequential Classes", "propertyValue": "sc", "type": "class", "scale": ["#d32b1d", "#023474"] }, { "name": "Custom Diverging gradient", "translation": "Custom Diverging gradient", "propertyValue": "dg", "type": "gradient", "scale": ["#1A2980", "#FFFFFF", "#26D0CE", "#d32b1d"] }, { "name": "Custom Diverging Classes", "translation": "Custom Diverging Classes", "propertyValue": "dc", "type": "class", "scale": ["#9C824A", "#EF0107", "#DB0007", "#FFFFFF", "#023474"] } ] } // 詳情請參閱官方文檔:https://help.qlik.com/en-US/sense-developer/February2018/Subsystems/Extensions/Content/CustomThemes/custom-themes-properties.htm?_ga=2.57217962.1673536238.1523350076-225234654.1523350076