【问题标题】:jqPlot meter gauge in drupaljqPlot仪表仪表在drupal中
【发布时间】:2014-04-11 20:45:07
【问题描述】:

我尝试在我的网站上添加仪表,我将 js 和 css 添加到我的信息文件中

比在页面中我有这个代码

    <script>$(document).ready(function(){
   s1 = [1];

   plot0 = $.jqplot('chart0',[s1],{
       title: 'Network Speed',
       seriesDefaults: {
           renderer: $.jqplot.MeterGaugeRenderer,
           rendererOptions: {
               label: 'MB/s'
           }
       }
   });
});
</script>
<div class="plot0" style="width:250px;height:170px;"></div>

它给了我一个错误“未捕获未指定情节目标”,有什么想法吗?

【问题讨论】:

    标签: javascript html drupal jqplot


    【解决方案1】:

    你需要给你的容器添加一个 id:

    <div id="chart0" class="plot0" style="width:250px;height:170px;"></div>
    

    然后使用这个 id 来绘制你的图表

    请看一个工作示例here on JSFiddle

    【讨论】:

    • 感谢您发布此信息。不幸的是,这个例子对我不起作用。没有渲染。有什么想法吗?
    猜你喜欢
    • 1970-01-01
    • 2018-02-16
    • 1970-01-01
    • 1970-01-01
    • 2012-09-14
    • 1970-01-01
    • 2015-04-22
    • 1970-01-01
    • 2019-07-21
    相关资源
    最近更新 更多