提交 fcfe8423 编写于 作者: O Ovilia

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

...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
import * as zrUtil from 'zrender/src/core/util'; 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'; import Text from 'zrender/src/graphic/Text';
/** /**
...@@ -28,7 +28,7 @@ import Text from 'zrender/src/graphic/Text'; ...@@ -28,7 +28,7 @@ import Text from 'zrender/src/graphic/Text';
function TooltipRichContent(api) { function TooltipRichContent(api) {
// this.el = new Group(); // this.el = new Group();
var zr = this._zr = api.getZr(); // var zr = this._zr = api.getZr();
// zr.add(this.el); // zr.add(this.el);
this._show = false; this._show = false;
......
...@@ -420,11 +420,23 @@ function isInLargeMode(seriesModel) { ...@@ -420,11 +420,23 @@ function isInLargeMode(seriesModel) {
return seriesModel.pipelineContext && seriesModel.pipelineContext.large; return seriesModel.pipelineContext && seriesModel.pipelineContext.large;
} }
// See cases in `test/bar-start.html` and `#7412`, `#8747`.
function getValueAxisStart(baseAxis, valueAxis, stacked) { function getValueAxisStart(baseAxis, valueAxis, stacked) {
return ( var extent = valueAxis.getGlobalExtent();
zrUtil.indexOf(baseAxis.getAxesOnZeroOf(), valueAxis) >= 0 var min;
|| stacked var max;
) if (extent[0] > extent[1]) {
? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)) min = extent[1];
: valueAxis.getGlobalExtent()[0]; 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. ...@@ -40,6 +40,7 @@ under the License.
<div id="main0"></div> <div id="main0"></div>
<div id="main1"></div>
<script> <script>
...@@ -64,6 +65,9 @@ under the License. ...@@ -64,6 +65,9 @@ under the License.
min: 5000000 min: 5000000
}, { }, {
}], }],
grid: {
left: 100
},
series: [{ series: [{
name: 'bar', name: 'bar',
type: 'bar', type: 'bar',
...@@ -72,7 +76,7 @@ under the License. ...@@ -72,7 +76,7 @@ under the License.
}, { }, {
name: 'line', name: 'line',
type: 'line', type: 'line',
yAxisIndex:1, yAxisIndex: 1,
data: [1.1496899,0.9420012,0.6743367,0.47701207,0.67934614,0.37843546] data: [1.1496899,0.9420012,0.6743367,0.47701207,0.67934614,0.37843546]
}] }]
}; };
...@@ -85,5 +89,72 @@ under the License. ...@@ -85,5 +89,72 @@ under the License.
}); });
</script> </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> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册