@ersinfotech/analysis-charts_utils
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -389,3 +389,6 @@ 'use strict'; | ||
const data = _.get(matrix, `["${columnName}"]["${subColumnName}"]["${rowName}"]["${rowKey}"]`); | ||
const val = _.get(data, `["${valueKey}"]`, '-'); | ||
let val = _.get(data, `["${valueKey}"]`, '0'); | ||
if (colSpan == 2 && val == '0') { | ||
val = ['0', '0']; | ||
} | ||
rowData.push(val); | ||
@@ -392,0 +395,0 @@ }); |
{ | ||
"name": "@ersinfotech/analysis-charts_utils", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "ISC", |
@@ -60,3 +60,6 @@ import _ from 'lodash'; | ||
); | ||
const val = _.get(data, `["${valueKey}"]`, '-'); | ||
let val = _.get(data, `["${valueKey}"]`, '0'); | ||
if (colSpan == 2 && val == '0') { | ||
val = ['0', '0']; | ||
} | ||
rowData.push(val); | ||
@@ -63,0 +66,0 @@ }); |
const { getRenderChartData } = require('./dist/index'); | ||
console.log('xxx'); | ||
const dataJson = { | ||
groups: [ | ||
{ | ||
id: 'q0c7e305968cb48b48a4d4a6ca4744373', | ||
type: 'checkbox', | ||
title: '2. 愛好', | ||
description: '', | ||
required: true, | ||
refer: null, | ||
blank_setting: [], | ||
qindex: 2, | ||
page: 0, | ||
qid: 'q0c7e305968cb48b48a4d4a6ca4744373', | ||
disabled: false, | ||
_id: 'keyword001', | ||
key: 'groups_q0c7e305968cb48b48a4d4a6ca4744373', | ||
name: '愛好', | ||
}, | ||
{ | ||
id: 'q6deda784300143079765e0275031cbc6', | ||
type: 'radio', | ||
title: 'q1. 性別', | ||
description: '', | ||
required: true, | ||
refer: null, | ||
serialNumber: 'q1', | ||
qindex: 'q1', | ||
page: 0, | ||
qid: 'q6deda784300143079765e0275031cbc6', | ||
disabled: false, | ||
_id: 'keyword000', | ||
key: 'groups_q6deda784300143079765e0275031cbc6', | ||
name: '性別', | ||
}, | ||
], | ||
values: [ | ||
{ key: 'count', name: '數量', title: '數量', _id: '_id', id: 'count' }, | ||
], | ||
chartProps: { | ||
title: { text: '交叉百分比', subText: '備註' }, | ||
decimalPlaces: 1, | ||
type: '2dTable', | ||
percentMode: { enabled: false }, | ||
percent: { enabled: true, denominator: 'CUSTOM' }, | ||
total: { enabled: true }, | ||
}, | ||
dataTotal: { 女: 2, 男: 2 }, | ||
data: [ | ||
{ | ||
count: 2, | ||
groups_q0c7e305968cb48b48a4d4a6ca4744373: '唱', | ||
groups_q6deda784300143079765e0275031cbc6: '男', | ||
}, | ||
{ | ||
count: 1, | ||
groups_q0c7e305968cb48b48a4d4a6ca4744373: '跳', | ||
groups_q6deda784300143079765e0275031cbc6: '男', | ||
}, | ||
{ | ||
count: 2, | ||
groups_q0c7e305968cb48b48a4d4a6ca4744373: '唱', | ||
groups_q6deda784300143079765e0275031cbc6: '女', | ||
}, | ||
{ | ||
count: 1, | ||
groups_q0c7e305968cb48b48a4d4a6ca4744373: '跳', | ||
groups_q6deda784300143079765e0275031cbc6: '女', | ||
}, | ||
{ | ||
count: 1, | ||
groups_q0c7e305968cb48b48a4d4a6ca4744373: 'rap', | ||
groups_q6deda784300143079765e0275031cbc6: '女', | ||
}, | ||
], | ||
}; | ||
const chartData = getRenderChartData({ | ||
data: dataJson.data, | ||
groups: dataJson.groups, | ||
values: dataJson.values, | ||
chartProps: dataJson.chartProps, | ||
dataTotal: dataJson.dataTotal, | ||
locale: 'en-US', | ||
}); | ||
console.log('xxx', chartData); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51796
1374