用setInterval定时刷新下面这个方法。- function BindLineChart(XNames, YNames_NI, YNames_TS, YNames_RS, YNames_KA, YNames_CL, YNames_TK, YNames_WA, ObjectChart) {
- var animation = {},
- seriesTransition = {},
- enabled = false,
- stEnabled = false;
- animation.enabled = enabled;
- seriesTransition.enabled = stEnabled;
- $("#C1LineChart_Case").c1linechart("option", "animation", animation);
- $("#C1LineChart_Case").c1linechart("option", "seriesTransition", seriesTransition);
- $("#C1LineChart_Case").c1linechart("option", "seriesList", [
- {
- label: "烟碱",
- legendEntry: true,
- markers: {
- visible: true,
- type: "circle"
- },
- data: { x: XNames, y: YNames_NI }
- }, {
- label: "总糖",
- legendEntry: true,
- markers: {
- visible: true,
- type: "circle"
- },
- data: { x: XNames, y: YNames_TS }
- }, {
- label: "还原糖",
- legendEntry: true,
- markers: {
- visible: true,
- type: "circle"
- },
- data: { x: XNames, y: YNames_RS }
- }, {
- label: "钾",
- legendEntry: true,
- markers: {
- visible: true,
- type: "circle"
- },
- data: { x: XNames, y: YNames_KA }
- }, {
- label: "氯",
- legendEntry: true,
- markers: {
- visible: true,
- type: "circle"
- },
- data: { x: XNames, y: YNames_CL }
- }, {
- label: "氮",
- legendEntry: true,
- markers: {
- visible: true,
- type: "circle"
- },
- data: { x: XNames, y: YNames_TK }
- }, {
- label: "水分",
- legendEntry: true,
- markers: {
- visible: true,
- type: "circle"
- },
- data: { x: XNames, y: YNames_WA }
- }
- ]);
- }
复制代码
可是当鼠标移到图表的某个点上时就会报错,鼠标不移到点上,不会报错。使用JS绑定的数据。 |