【问题标题】:JQuery jqplot legend not showing good [closed]JQuery jqplot图例显示不佳[关闭]
【发布时间】:2013-12-12 10:06:09
【问题描述】:

我正在尝试使用 jQplot 创建图表。它工作得很好,但我想要一个像 http://www.jqplot.com/tests/pie-donut-charts.php 这样的传奇。但我的传说不像在 jqplot 网站上那样工作。输出的图片如下所示。有人注意到我想念什么吗?这里附上代码

$('#tes').live('pageshow', function() {
        var data = [
['A', 12],['B', 9], ['C', 14],
['D', 16],['E', 7]];
var plot1 = jQuery.jqplot ('chart1', [data],
{
  seriesDefaults: {
    // Make this a pie chart.
    renderer: jQuery.jqplot.PieRenderer,
    rendererOptions: {
      // Put data labels on the pie slices.
      // By default, labels show the percentage of the slice.
      showDataLabels: true,
      dataLabels: 'value'
    }
  },
  legend: { show:true, location: 'e' }
}
);
});

【问题讨论】:

    标签: javascript jquery jquery-mobile jquery-plugins


    【解决方案1】:

    我已经解决了这个问题。问题是因为我没有添加 jquery.jqplot.css 文件

    【讨论】:

      【解决方案2】:

      您可能没有添加 jquery.jqplot.css。 确保您已添加以下 js 和 css:

      <script type="text/javascript" src="jquery.min.js"></script>
      <script type="text/javascript" src="jquery.jqplot.min.js"></script>
      <script type="text/javascript" src="jqplot.donutRenderer.min.js"></script>
      <script type="text/javascript" src="jqplot.pieRenderer.min.js"></script>
      
      
      <link rel="stylesheet" href="jquery.jqplot.css" type="text/css" />
      

      【讨论】:

        猜你喜欢
        • 2016-06-20
        • 2012-07-24
        • 2013-02-21
        • 2021-10-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多