We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
以下是我的代码配置: 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() 烦请哪位大佬伴我看看
The text was updated successfully, but these errors were encountered:
贴一个sandbox
Sorry, something went wrong.
No branches or pull requests
以下是我的代码配置:
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()
烦请哪位大佬伴我看看
The text was updated successfully, but these errors were encountered: