提交 fcfe8423 编写于 作者: O Ovilia

Merge branch 'master' of github.com:ecomfe/echarts

......@@ -18,7 +18,7 @@
*/
import * as zrUtil from 'zrender/src/core/util';
import Group from 'zrender/src/container/Group';
// import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
/**
......@@ -28,7 +28,7 @@ import Text from 'zrender/src/graphic/Text';
function TooltipRichContent(api) {
// this.el = new Group();
var zr = this._zr = api.getZr();
// var zr = this._zr = api.getZr();
// zr.add(this.el);
this._show = false;
......
......@@ -420,11 +420,23 @@ function isInLargeMode(seriesModel) {
return seriesModel.pipelineContext && seriesModel.pipelineContext.large;
}
// See cases in `test/bar-start.html` and `#7412`, `#8747`.
function getValueAxisStart(baseAxis, valueAxis, stacked) {
return (
zrUtil.indexOf(baseAxis.getAxesOnZeroOf(), valueAxis) >= 0
|| stacked
)
? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0))
: valueAxis.getGlobalExtent()[0];
var extent = valueAxis.getGlobalExtent();
var min;
var max;
if (extent[0] > extent[1]) {
min = extent[1];
max = extent[0];
}
else {
min = extent[0];
max = extent[1];
}
var valueStart = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));
valueStart < min && (valueStart = min);
valueStart > max && (valueStart = max);
return valueStart;
}
......@@ -40,6 +40,7 @@ under the License.
<div id="main0"></div>
<div id="main1"></div>
<script>
......@@ -64,6 +65,9 @@ under the License.
min: 5000000
}, {
}],
grid: {
left: 100
},
series: [{
name: 'bar',
type: 'bar',
......@@ -72,7 +76,7 @@ under the License.
}, {
name: 'line',
type: 'line',
yAxisIndex:1,
yAxisIndex: 1,
data: [1.1496899,0.9420012,0.6743367,0.47701207,0.67934614,0.37843546]
}]
};
......@@ -85,5 +89,72 @@ under the License.
});
</script>
<script>
// See <https://github.com/apache/incubator-echarts/issues/8747>
// Thanks to <https://github.com/kuky121>
var chart;
var myChart;
var option;
require([
'echarts'/*, 'map/js/china' */
], function (echarts) {
var option = {
xAxis : [
{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis : [
{
type : 'value'
},
{
type : 'value'
}
],
series : [
{
yAxisIndex:0,
name:'数据1',
type:'bar',
data:[10, -52]
},
{
yAxisIndex:1,
name:'数据2',
type:'bar',
data:[10, -52]
}
]
};
chart = myChart = testHelper.create(echarts, 'main1', {
title: 'bar start should be correct when two Y axes exists',
option: option,
info: 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.
先完成此消息的编辑!
想要评论请 注册