首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jqplot面积图

jqplot面积图
EN

Stack Overflow用户
提问于 2016-04-27 20:51:16
回答 1查看 210关注 0票数 0

我正在使用jqplot,代码如下:

代码语言:javascript
复制
<!DOCTYPE html>
<html>
<head>
  <script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jqPlot/1.0.8/jquery.jqplot.min.js" type="text/javascript"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jqPlot/1.0.8/plugins/jqplot.pieRenderer.min.js" type="text/javascript"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jqPlot/1.0.8/plugins/jqplot.categoryAxisRenderer.min.js" type="text/javascript"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jqPlot/1.0.8/plugins/jqplot.highlighter.min.js" type="text/javascript"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jqPlot/1.0.8/plugins/jqplot.canvasTextRenderer.min.js" type="text/javascript"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jqPlot/1.0.8/plugins/jqplot.canvasAxisTickRenderer.min.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/jqPlot/1.0.8/jquery.jqplot.min.css" />

  <title>Chart 5</title>
</head>

<body>
  <script type="text/javascript">
    $(document).ready(function (){
      var l1 = [78, 75, 77, 78, 80, 83, 90, 96, 99, 82];
      var l2 = [4, 8, 5, 3, 6];
      var l3 = [12, 6, 13, 11, 2];

      var plot1 = $.jqplot('chart1b', [l1], {
        stackSeries: true,

        showMarker: true,

        seriesDefaults: {
          fill: true,
          pointLabels: {
            show: true
          }
        },

        axes: {
          xaxis: {
            renderer: $.jqplot.CategoryAxisRenderer,
            ticks: ['12 AM \n 3/13', '8 AM', '4 PM', '12 AM \n 3/14', '8 AM', '4 PM', '12 AM \n 3/15', '8 AM', '4 PM', '12 AM \n 3/16']
          },

          /*yaxis: {
            min: 0,
            max: 100
          }*/
          yaxis: {
            tickInterval: 25,
            showTicks: true,
            showTickMarks: true,
            ticks: [0, 25, 50, 75, 100]
          }
        },

        highlighter: {
          show: true,
          showTooltip: true
        }
      });
    });
  </script>
  <h2>Area Chart</h2>
  <div style="width: 500px; height: 300px;" id='chart1b'></div>
</body>
</html>

我希望只突出显示最小和最大数据点,而不是突出显示所有数据点。有没有办法做这件事,请提个建议。

EN

回答 1

Stack Overflow用户

发布于 2016-04-27 21:33:58

我对你的图表做了一些修改,因为我没有得到你真正想要的,所以在一些分析的基础上,我用jsfiddle创建了一个图表,你可以从这里得到它,

代码语言:javascript
复制
jsfiddle.net/fhdd8/358/
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36890378

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档