當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript jQuery.plot函數代碼示例

本文整理匯總了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();
    }
  }
開發者ID:CorpGlory,項目名稱:grafana,代碼行數:18,代碼來源:graph.ts

示例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();
          }
        }
開發者ID:casaria,項目名稱:grafana-trillium-src-fork,代碼行數:18,代碼來源:graph.ts

示例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);
    });
  }
開發者ID:YuhangGe,項目名稱:grafana,代碼行數:65,代碼來源:rendering.ts


注:本文中的jQuery.plot函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。