本文整理汇总了TypeScript中jQuery.plot函数的典型用法代码示例。如果您正苦于以下问题:TypeScript plot函数的具体用法?TypeScript plot怎么用?TypeScript plot使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了plot函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: callPlot
callPlot(options, incrementRenderCounter) {
try {
this.plot = $.plot(this.elem, this.sortedSeries, options);
if (this.ctrl.renderError) {
delete this.ctrl.error;
delete this.ctrl.inspector;
}
} catch (e) {
console.log('flotcharts error', e);
this.ctrl.error = e.message || 'Render Error';
this.ctrl.renderError = true;
this.ctrl.inspector = { error: e };
}
if (incrementRenderCounter) {
this.ctrl.renderingCompleted();
}
}
示例2: callPlot
function callPlot(incrementRenderCounter) {
try {
plot = $.plot(elem, sortedSeries, options);
if (ctrl.renderError) {
delete ctrl.error;
delete ctrl.inspector;
}
} catch (e) {
console.log('flotcharts error', e);
ctrl.error = e.message || "Render Error";
ctrl.renderError = true;
ctrl.inspector = {error: e};
}
if (incrementRenderCounter) {
ctrl.renderingCompleted();
}
}
示例3: addPieChart
function addPieChart() {
var width = elem.width();
var height = elem.height();
var size = Math.min(width, height);
var plotCanvas = $('<div></div>');
var plotCss = {
top: '10px',
margin: 'auto',
position: 'relative',
height: (size - 20) + 'px'
};
plotCanvas.css(plotCss);
var $panelContainer = elem.parents('.panel-container');
var strokecolor = $panelContainer.css('background-color');
var options = {
legend: {
show: false
},
series: {
pie: {
show: true,
stroke: {
color: strokecolor,
width: 0.3
},
label: {
show: ctrl.panel.legend.show && ctrl.panel.legendType === 'On graph'
},
innerRadius: undefined
}
},
grid: {
hoverable: true
}
};
if (panel.pieType === 'donut') {
options.series.pie.innerRadius = 0.5;
}
elem.html(plotCanvas);
$.plot(plotCanvas, ctrl.data, options);
plotCanvas.bind("plothover", function (event, pos, item) {
if (!item) {
$tooltip.detach();
return;
}
var body;
var percent = parseFloat(item.series.percent).toFixed(2);
var formatted = ctrl.formatValue(item.series.data[0][1]);
body = '<div class="graph-tooltip-small"><div class="graph-tooltip-time">';
body += '<div class="graph-tooltip-value">' + item.series.label + ': ' + formatted;
body += " (" + percent + "%)" + '</div>';
body += "</div></div>";
$tooltip.html(body).place_tt(pos.pageX + 20, pos.pageY);
});
}