清空时间轴
清空时间轴
thinkEditor.SetTimeAxisConfig("", {
clean: true,
grid: {
beginTime: "2024-01-09 00:00:00",
endTime: "2024-01-22 23:59:59",
},
});
thinkEditor.UpdateTimeAxis(""); //必要
设置X轴数据
设置X轴数据
thinkEditor.SetTimeAxisConfig("", {
clean: true,
grid: {
beginTime: "2024-01-09 00:00:00",
endTime: "2024-01-22 23:59:59",
},
});
thinkEditor.SetTimeData([
{
id: "huxi",
timeData: [
{ time: "2024-01-11 02:00:00", text: "55" },
{ time: "2024-01-12 12:00:00", text: "50" },
],
},
]);
thinkEditor.UpdateTimeAxis(""); //必要
自定义x轴-带格式内容
- 说明:1、使用fragment设置时,时间点不应当再有text/value字段
- 2、使用spaceAfter、spaceBefore实现交替值显示位置交替偏移
- 应用需自行正确设置spaceAfter、spaceBefore
自定义x轴-带格式内容
/*******************************
* 自定义x轴 带格式内容
* *********************************/
export const SetTimeDataXAxisTest1 = () => {
let thinkEditor = window.thinkEditor1;
thinkEditor.SetTimeAxisConfig("", {
clean: true,
grid: {
beginTime: "2024-01-09 00:00:00",
endTime: "2024-01-22 23:59:59",
},
});
thinkEditor.SetTimeData([
{
id: "huxi",
timeData: [
{ time: "2024-01-11 02:00:00", fragment: "<Paragraph spaceAfter='0.5'><Font size='0.31' color='1e90ff' cfg='10' />R</Paragraph>" },
{ time: "2024-01-12 12:00:00", fragment: "<Paragraph spaceBefore='0.5'><Font size='0.31' color='1e90ff' cfg='10' />R</Paragraph>" }
],
},
]);
thinkEditor.UpdateTimeAxis(""); //必要
};
文档更新时间: 2025-05-27 19:30 作者:admin