Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤔 [QUESTION] 区间条形图配置了slider缩略轴,移动缩略轴是根据y轴来显示隐藏的,不是根据x轴配置的时间去显示的,是缩略轴不支持区间条形图吗 #3642

Open
liujiyong35 opened this issue Aug 18, 2023 · 1 comment
Labels
Question Further information is requested

Comments

@liujiyong35
Copy link

以下是我的代码配置:
const data =[
{
id: 1,
timeRange: ['2023-03-01', '2023-03-22'],
name: '一期基础',
},
{
id: 2,
timeRange: ['2023-03-23', '2023-05-11'],
name: '1#',
},
{
id: 3,
timeRange: ['2023-04-12', '2023-05-31'],
name: '2#',
},
{
id: 4,
timeRange: ['2023-05-02', '2023-06-20'],
name: '3#',
},
{
id: 5,
timeRange: ['2023-05-22', '2023-07-10'],
name: '4#',
},
{
id: 6,
timeRange: ['2023-06-11', '2023-07-30'],
name: '5#',
},
{
id: 7,
timeRange: ['2023-07-01', '2023-08-19'],
name: '6#',
},
{
id: 8,
timeRange: ['2023-07-21', '2023-09-08'],
name: '7#',
},
{
id: 9,
timeRange: ['2023-08-10', '2023-09-28'],
name: '8#',
},
{
id: 10,
timeRange: ['2023-08-30', '2023-10-18'],
name: '9#',
},
{
id: 11,
timeRange: ['2023-09-19', '2023-11-07'],
name: '10#',
},
{
id: 13,
timeRange: ['2023-11-08', '2023-12-17'],
name: '配套区域1',
},
{
id: 14,
timeRange: ['2023-11-08', '2023-12-17'],
name: '配套区域2',
},
{
id: 15,
timeRange: ['2023-12-18', '2024-01-06'],
name: '绿化区',
},
]
let element = document.getElementById('container')
if (!element) return
const barPlot = new Bar(element, {
data,
xField: 'timeRange', // Time interval range
yField: 'name', // Classification
isRange: true,
xAxis: {
type: 'time',
min: '2023-03-01',
max: '2024-01-06',
// tickCount: 5, // Customize the number of ticks on the x-axis
tickMethod: 'time',
label: {
style: {
fill: '#666666', // X轴标签字体颜色
},
},
},
yAxis: {
label: {
style: {
fill: '#666666', // Y轴标签字体颜色
},
},
line: {
style: {
stroke: '#DDDDDD', // Y轴轴线颜色
},
},
},
tickLine: {
style: {
stroke: '#e5e5e5', // Y轴刻度线颜色
},
},
slider: {
start: 0,
end: 1,
onChange: (range) => {
console.log(range)
},
},
color: '#045DFF',
})
barPlot.render()
烦请哪位大佬伴我看看

@liujiyong35 liujiyong35 added the Question Further information is requested label Aug 18, 2023
@HHN0609
Copy link

HHN0609 commented Jun 19, 2024

贴一个sandbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants