提交 f42e68e0 编写于 作者: D deqingli
......@@ -112,6 +112,9 @@ rules:
operator-linebreak:
- 2
- "before"
-
overrides:
"=": "after"
quotes:
- 2
- "single"
......
......@@ -74554,8 +74554,11 @@ function getAxisKey$1(axis) {
*/
function barLayoutPolar(seriesType, ecModel, api) {
// var width = api.getWidth();
// var height = api.getHeight();
// FIXME
// Revert becuase it brings bar progressive bug.
// The complete fix will be added in the next version.
var width = api.getWidth();
var height = api.getHeight();
var lastStackCoords = {};
此差异已折叠。
此差异已折叠。
......@@ -74612,8 +74612,11 @@ function getAxisKey$1(axis) {
*/
function barLayoutPolar(seriesType, ecModel, api) {
// var width = api.getWidth();
// var height = api.getHeight();
// FIXME
// Revert becuase it brings bar progressive bug.
// The complete fix will be added in the next version.
var width = api.getWidth();
var height = api.getHeight();
var lastStackCoords = {};
此差异已折叠。
此差异已折叠。
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('echarts')) :
typeof define === 'function' && define.amd ? define(['exports', 'echarts'], factory) :
......
{
"name": "echarts",
"version": "4.2.0-rc.1",
"version": "4.2.0-rc.2",
"description": "A powerful charting and visualization library for browser",
"keywords": [
"visualization",
......
......@@ -28,9 +28,10 @@ import './bar/BarView';
import '../component/gridSimple';
echarts.registerLayout(zrUtil.curry(layout, 'bar'));
// Should after normal bar layout, otherwise it is blocked by normal bar layout.
echarts.registerLayout(largeLayout);
echarts.registerLayout(echarts.PRIORITY.VISUAL.LAYOUT, zrUtil.curry(layout, 'bar'));
// Use higher prority to avoid to be blocked by other overall layout, which do not
// only exist in this module, but probably also exist in other modules, like `barPolar`.
echarts.registerLayout(echarts.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, largeLayout);
echarts.registerVisual({
seriesType: 'bar',
......
......@@ -28,29 +28,27 @@ export default function (ecModel) {
return;
}
function pointsConverter(val, idx) {
points[idx] = points[idx] || [];
points[idx][i] = coordSys.dataToPoint(val, i);
}
var axes = coordSys.getIndicatorAxes();
for (var i = 0; i < axes.length; i++) {
data.each(data.mapDimension(axes[i].dim), pointsConverter);
}
zrUtil.each(axes, function (axis, axisIndex) {
data.each(data.mapDimension(axes[axisIndex].dim), function (val, dataIndex) {
points[dataIndex] = points[dataIndex] || [];
points[dataIndex][axisIndex] = coordSys.dataToPoint(val, axisIndex);
});
});
// Close polygon
data.each(function (idx) {
// Close polygon
// TODO
// Is it appropriate to connect to the next data when some data is missing?
// Or, should trade it like `connectNull` in line chart?
var firstPoint = zrUtil.find(points[idx], function (point) {
return !isNaN(point[0]) && !isNaN(point[1]);
}) || [NaN, NaN];
var firstPoint = findFirstActualPoint();
// Copy the first actual point to the end of the array
points[idx].push(firstPoint.slice());
data.setItemLayout(idx, points[idx]);
function findFirstActualPoint() {
return zrUtil.find(points[idx], function (point) {
return !isNaN(point[0]) && !isNaN(point[1]);
}) || ['NaN', 'NaN'];
}
});
});
}
\ No newline at end of file
......@@ -118,7 +118,7 @@ var CartesianAxisView = AxisView.extend({
// Simple optimization
// Batching the lines if color are the same
var lineStyle = lineStyleModel.getLineStyle();
for (var i = 1; i < ticksCoords.length; i++) {
for (var i = 0; i < ticksCoords.length; i++) {
var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord);
if (isHorizontal) {
......
......@@ -63,6 +63,7 @@ var PRIORITY_PROCESSOR_FILTER = 1000;
var PRIORITY_PROCESSOR_STATISTIC = 5000;
var PRIORITY_VISUAL_LAYOUT = 1000;
var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;
var PRIORITY_VISUAL_GLOBAL = 2000;
var PRIORITY_VISUAL_CHART = 3000;
var PRIORITY_VISUAL_COMPONENT = 4000;
......@@ -77,6 +78,7 @@ export var PRIORITY = {
},
VISUAL: {
LAYOUT: PRIORITY_VISUAL_LAYOUT,
PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,
GLOBAL: PRIORITY_VISUAL_GLOBAL,
CHART: PRIORITY_VISUAL_CHART,
COMPONENT: PRIORITY_VISUAL_COMPONENT,
......
......@@ -37,9 +37,6 @@ function getAxisKey(axis) {
*/
function barLayoutPolar(seriesType, ecModel, api) {
// var width = api.getWidth();
// var height = api.getHeight();
var lastStackCoords = {};
var barWidthAndOffset = calRadialBar(
......@@ -54,6 +51,7 @@ function barLayoutPolar(seriesType, ecModel, api) {
);
ecModel.eachSeriesByType(seriesType, function (seriesModel) {
// Check series coordinate, do layout for polar only
if (seriesModel.coordinateSystem.type !== 'polar') {
return;
......
......@@ -546,7 +546,7 @@ var GlobalModel = Model.extend({
* After filtering, series may be different.
* frome raw series.
*
* @parma {string} subType
* @param {string} subType.
* @param {Function} cb
* @param {*} context
*/
......
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta charset="utf-8">
<script src="lib/esl.js"></script>
<script src="lib/config.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="lib/dat.gui.min.js"></script>
</head>
<body>
<style>
html, body, #main {
width: 100%;
height: 100%;
margin: 0;
}
</style>
<div id="main"></div>
<script>
require([
'echarts',
'extension/dataTool',
'theme/vintage'
], function (echarts, dataTool) {
var gexf = dataTool.gexf;
var chart = echarts.init(document.getElementById('main'), 'vintage', {
});
var option = {
title: {
text: 'Graph Label Rotate'
},
tooltip: {},
animationDurationUpdate: 1500,
animationEasingUpdate: 'quinticInOut',
series : [
{
type: 'graph',
layout: 'none',
symbolSize: 50,
roam: true,
label: {
show: true,
rotate: 30,
fontWeight:5,
fontSize: 26,
color: "#000",
distance: 15,
position: 'inside',
verticalAlign: 'middle'
},
edgeSymbol: ['circle', 'arrow'],
edgeSymbolSize: [4, 10],
edgeLabel: {
normal: {
textStyle: {
fontSize: 20
}
}
},
data: [{
name: 'rotate 30',
x: 300,
y: 300
}, {
name: 'rotate 45',
x: 500,
y: 600,
label: {
rotate: -30
}
}],
emphasis: {
label: {
rotate: 45
}
}
}
]
}
chart.setOption(option);
});
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册