本文整理匯總了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);
});
}