Skip to content

Commit

Permalink
Merge pull request #265 from antvis/fix-line-area-x-date
Browse files Browse the repository at this point in the history
Fix line area x date
  • Loading branch information
paleface001 committed Nov 19, 2019
2 parents 3efeac4 + 46130a1 commit aeb57ad
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 18 deletions.
24 changes: 17 additions & 7 deletions examples/area/basic/demo/slider.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
import { Area } from '@antv/g2plot';

fetch('../data/sales.json')
fetch('../data/fireworks-sales.json')
.then((res) => res.json())
.then((data) => {
const areaPlot = new Area(document.getElementById('container'), {
title: {
visible: true,
text: '基础面积图 - 缩略轴',
},
description: {
visible: true,
text: '缩略轴 (slider) 交互适用于数据较多,用户希望关注数据集中某个特殊区间的场景。',
},
data,
xField: '城市',
xField: 'Date',
xAxis: {
visible: true,
autoHideLabel: true,
type: 'dateTime',
tickCount: 5,
},
yField: 'scales',
yAxis: {
label: {
// 数值格式化为千分位
formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`),
},
},
yField: '销售额',
interactions: [
{
type: 'slider',
cfg: {
start: 0.5,
end: 0.55,
start: 0.2,
end: 0.7,
},
},
],
Expand Down
4 changes: 4 additions & 0 deletions examples/line/basic/demo/line-point-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const linePlot = new Line(document.getElementById('container'), {
visible: true,
text: '配置折线数据点样式',
},
description: {
visible: true,
text: '自定义配置趋势线上数据点的样式',
},
padding: 'auto',
forceFit: true,
data,
Expand Down
20 changes: 13 additions & 7 deletions examples/line/basic/demo/line-slider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Line } from '@antv/g2plot';

fetch('../data/sales.json')
fetch('../data/fireworks-sales.json')
.then((res) => res.json())
.then((data) => {
const linePlot = new Line(document.getElementById('container'), {
Expand All @@ -15,18 +15,24 @@ fetch('../data/sales.json')
forceFit: true,
padding: 'auto',
data,
xField: '城市',
xField: 'Date',
xAxis: {
visible: true,
autoHideLabel: true,
type: 'dateTime',
tickCount: 5,
},
yField: 'scales',
yAxis: {
label: {
// 数值格式化为千分位
formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`),
},
},
yField: '销售额',
interactions: [
{
type: 'slider',
cfg: {
start: 0.1,
end: 0.2,
start: 0.2,
end: 0.7,
},
},
],
Expand Down
4 changes: 4 additions & 0 deletions examples/line/basic/demo/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ fetch('../data/fireworks-sales.json')
visible: true,
text: '单折线图的基础用法',
},
description: {
visible: true,
text: '最基础简单的折线图使用方式,显示一个指标的趋势',
},
forceFit: true,
data,
padding: 'auto',
Expand Down
1 change: 0 additions & 1 deletion src/plots/stack-column/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default class StackColumnLayer<
public init() {
if (this.options.connectedArea.visible) {
this.options.tooltip.crosshairs = null;
console.log(this.options);
}
super.init();
}
Expand Down
6 changes: 3 additions & 3 deletions src/theme/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const DEFAULT_GLOBAL_THEME = {
visible: false,
offset: 12,
style: {
fill: 'rgba(0, 0, 0, 0.95)',
fill: 'rgba(0, 0, 0, 0.65)',
fontSize: 12,
textBaseline: 'bottom',
},
Expand Down Expand Up @@ -143,7 +143,7 @@ export const DEFAULT_GLOBAL_THEME = {
title: {
visible: false,
offset: 12,
style: { fill: 'rgba(0, 0, 0, 0.95)', fontSize: 12 },
style: { fill: 'rgba(0, 0, 0, 0.65)', fontSize: 12 },
},
},
circle: {
Expand Down Expand Up @@ -194,7 +194,7 @@ export const DEFAULT_GLOBAL_THEME = {
label: {
offset: 12,
style: {
fill: 'rgba(0, 0, 0, 0.95)',
fill: 'rgba(0, 0, 0, 0.65)',
stroke: '#ffffff',
lineWidth: 2,
},
Expand Down

0 comments on commit aeb57ad

Please sign in to comment.