未验证 提交 63dd98ac 编写于 作者: P plainheart

style: fix code style flaw and remove unnecessary default parameter. (#17098)

上级 0f149dc8
......@@ -86,7 +86,11 @@ class BaseBarSeriesModel<Opts extends BaseBarSeriesOption<unknown> = BaseBarSeri
return createSeriesData(null, this, {useEncodeDefaulter: true});
}
getMarkerPosition(value: ScaleDataValue[], dims?: typeof dimPermutations[number], startingAtTick: boolean = false) {
getMarkerPosition(
value: ScaleDataValue[],
dims?: typeof dimPermutations[number],
startingAtTick?: boolean
) {
const coordSys = this.coordinateSystem;
if (coordSys && coordSys.clampData) {
// PENDING if clamp ?
......
......@@ -183,7 +183,7 @@ function getSingleMarkerEndPoint(
else {
pointValue[1] = (clampPointValue0[1] > clampPointValue1[1]) ? pointValue0[1] : pointValue1[1];
}
// Use the getMarkerPoisition
// Use the getMarkerPosition
point = seriesModel.getMarkerPosition(
pointValue, dims, true
);
......
......@@ -103,7 +103,8 @@ interface SeriesModel {
getMarkerPosition(
value: ScaleDataValue[],
dims?: typeof dimPermutations[number],
startingAtTick?:boolean): number[];
startingAtTick?: boolean
): number[];
/**
* Get legend icon symbol according to each series type
......
......@@ -25,7 +25,6 @@ under the License.
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="lib/simpleRequire.js"></script>
<script src="lib/config.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="lib/facePrint.js"></script>
<script src="lib/testHelper.js"></script>
<!-- <script src="ut/lib/canteen.js"></script> -->
......@@ -43,137 +42,128 @@ under the License.
<script>
require([
'echarts',
// 'map/js/china',
// './data/nutrients.json'
'echarts'
], function (echarts) {
var option;
option = {
xAxis: {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
},
yAxis: {
type: 'value'
},
series: [
},
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
markArea: {
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
markArea: {
data: [
[
[
{
name: 'Invert input',
xAxis: 'Thu'
name: 'Invert input',
xAxis: 'Thu'
},
{
xAxis: 'Mon'
xAxis: 'Mon'
}
]
]
]
}
}
},
{
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
markArea: {
data: [120, 200, 150, 80, 70, 110, 130],
type: 'bar',
markArea: {
data: [
[
[
{
name: 'Single Emphasis',
xAxis: 'Sun'
name: 'Single Emphasis',
xAxis: 'Sun'
},
{
xAxis: 'Sun'
xAxis: 'Sun'
}
]
]
]
}
}
}
]
]
};
var chart = testHelper.create(echarts, 'main0', {
title: [
`MarkArea should be covering the 'Mon' to 'Thu' area and 'Sun' area`,
`MarkArea should cover the **'Mon'** to **'Thu'** area and **'Sun'** area`,
`rather than area between bars inside. (See issue#12341)`
],
option: option
// height: 300,
// buttons: [{text: 'btn-txt', onclick: function () {}}],
// recordCanvas: true,
});
});
</script>
<script>
require([
'echarts',
// 'map/js/china',
// './data/nutrients.json'
'echarts'
], function (echarts) {
var option;
option = {
xAxis: {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
},
yAxis: {
type: 'category',
data: ['Sleep', 'Exercise', 'Gardening', 'Gaming', 'Work']
},
series: [
},
series: [
{
data: ['Work', 'Exercise', 'Work', 'Gardening', 'Gaming' ],
type: 'bar',
markArea: {
data: [
[
{
name: 'Dual Axes specified Emphasis',
xAxis: 'Fri',
yAxis: 'Work'
},
{
xAxis: 'Mon',
yAxis: 'Gardening'
}
]
]
}
data: ['Work', 'Exercise', 'Work', 'Gardening', 'Gaming'],
type: 'bar',
markArea: {
data: [
[
{
name: 'Dual Axes specified Emphasis',
xAxis: 'Fri',
yAxis: 'Work'
},
{
xAxis: 'Mon',
yAxis: 'Gardening'
}
]
]
}
},
{
data: ['Gardening', 'Work', 'Exercise', 'Exercise', 'Gardening'],
type: 'bar',
markArea: {
data: [
[
{
name: 'Coord specified Emphasis',
coord:['Mon', 'Exercise']
},
{
coord:['Tue', 'Gardening']
}
]
]
}
data: ['Gardening', 'Work', 'Exercise', 'Exercise', 'Gardening'],
type: 'bar',
markArea: {
data: [
[
{
name: 'Coord specified Emphasis',
coord: ['Mon', 'Exercise']
},
{
coord: ['Tue', 'Gardening']
}
]
]
}
}
]
]
};
var chart = testHelper.create(echarts, 'main1', {
title: [
`MarkArea should be covering the 'Mon' to 'Fri' area and 'Exercise' to 'Gaming' area`,
`MarkArea should cover the **'Mon'** to **'Fri'** area and **'Exercise'** to **'Gaming'** area`,
`rather than area between bars inside. (Dual category axes for bar chart is rare)`
],
option: option
// height: 300,
// buttons: [{text: 'btn-txt', onclick: function () {}}],
// recordCanvas: true,
});
});
</script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册