提交 6b52f7e0 编写于 作者: P pah100

dim update

上级 48a625b8
......@@ -81,17 +81,13 @@ define(function(require) {
function translateCategoryValue(axisModel, dim, rawData) {
var axisData = axisModel.get('data');
// FIXME
// 这转换是否放在公用地方
var dimIndex = +dim.replace('dim', '');
if (axisData && axisData.length) {
zrUtil.each(rawData, function (dataItem) {
if (!dataItem) {
return;
}
var index = zrUtil.indexOf(axisData, dataItem[dimIndex]);
dataItem[dimIndex] = index >= 0 ? index : NaN;
var index = zrUtil.indexOf(axisData, dataItem[dim]);
dataItem[dim] = index >= 0 ? index : NaN;
});
}
// FIXME
......
......@@ -90,7 +90,10 @@ define(function(require) {
type: 'value',
dim: null, // 'dim0', 'dim1', 'dim2', ...
/**
* @type {Array.<number>}
*/
dim: null, // 0, 1, 2, ...
parallelIndex: null,
......
......@@ -96,7 +96,7 @@ define(function(require) {
});
zrUtil.each(axisModels, function (axisModel) {
dimensions.push(axisModel.get('dim'));
dimensions.push('dim' + axisModel.get('dim'));
parallelAxisIndex.push(axisModel.componentIndex);
});
}
......
......@@ -237,10 +237,10 @@
function makeParallelAxisOption(secondOpt) {
return [
{dim: 'dim0', name: '维度1'},
{dim: 0, name: '维度1'},
zrUtil.merge({dim: 'dim1', name: '维度2'}, secondOpt, true),
{dim: 'dim2', name: '维度3'},
{dim: 'dim3', name: '维度4'}
{dim: 2, name: '维度3'},
{dim: 3, name: '维度4'}
];
}
......
......@@ -89,14 +89,14 @@
// parallelAxisIndex: [0]
// },
parallelAxis: [
{dim: 'dim0', name: schema[0].text, inverse: true, max: 31, nameLocation: 'start'},
{dim: 'dim1', name: schema[1].text},
{dim: 'dim2', name: schema[2].text},
{dim: 'dim3', name: schema[3].text},
{dim: 'dim4', name: schema[4].text},
{dim: 'dim5', name: schema[5].text},
{dim: 'dim6', name: schema[6].text},
{dim: 'dim7', name: schema[7].text,
{dim: 0, name: schema[0].text, inverse: true, max: 31, nameLocation: 'start'},
{dim: 1, name: schema[1].text},
{dim: 2, name: schema[2].text},
{dim: 3, name: schema[3].text},
{dim: 4, name: schema[4].text},
{dim: 5, name: schema[5].text},
{dim: 6, name: schema[6].text},
{dim: 7, name: schema[7].text,
type: 'category', data: ['', '', '轻度污染', '中度污染', '重度污染', '严重污染']}
],
parallel: {
......
......@@ -103,7 +103,7 @@
formatter: getTooltipFormatter(mode)
},
series: [{
visualDimension: mode === 2 ? 'dim2' : null,
visualDimension: mode === 2 ? 2 : null,
data: buildData(mode, window.obama_budget_2012),
levels: getLevelOption(mode)
}]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册