【问题标题】:Changing Pie chart proportions using jChartFX使用 jChartFX 更改饼图比例
【发布时间】:2013-09-02 19:36:53
【问题描述】:

任何想法如何更改相对于其父图表 div 的图表比例?

目前是这样的

... 它应该看起来像这样

可在此处找到用作此示例基础的代码

http://support.softwarefx.com/jChartFX/article/2501235#27182674-0690-e211-84a5-0019b9e6b500


HTML

<!DOCTYPE html>
<html>
<head>
   <title>Customized Tooltips</title>
   <link rel="stylesheet" type="text/css" href="http://www.jchartfx.com/libs/v7/current/styles/jchartfx.css"/>
   <link rel="stylesheet" type="text/css" href="sample.css"/>

   <script type="text/javascript" src="http://www.jchartfx.com/libs/v7/current/js/jchartfx.system.js"></script>
   <script type="text/javascript" src="http://www.jchartfx.com/libs/v7/current/js/jchartfx.coreVector.js"></script>
   <script type="text/javascript" src="http://www.jchartfx.com/libs/v7/current/js/jchartfx.coreVector3d.js"></script>
   <script type="text/javascript" src="http://www.jchartfx.com/libs/v7/current/js/jchartfx.advanced.js"></script>
   <script type="text/javascript" src="http://www.jchartfx.com/libs/v7/current/js/jchartfx.animation.js"></script>
   <script type="text/javascript" src="sample.js"></script>

</head>
<body>
    <div id="ChartDiv1" style="width:550px;height:400px;display:inline-block"></div>
</body>
</html>



  var chart1;

  function onLoadDoc() {
        chart1 = new cfx.Chart();
        chart1.setGallery(cfx.Gallery.Pie);
        chart1.getAnimations().getLoad().setEnabled(true);
        var pie = chart1.getGalleryAttributes();
        pie.setExplodingMode(cfx.ExplodingMode.First);

        chart1.getView3D().setEnabled(true);
        chart1.getLegendBox().setVisible(true);

        //...
    }

【问题讨论】:

    标签: javascript css css3pie jchartfx


    【解决方案1】:

    您可以使用边距属性:

    chart1.getPlotAreaMargin().setTop(0);
    chart1.getPlotAreaMargin().setBottom(0);
    chart1.getPlotAreaMargin().setRight(0);
    chart1.getPlotAreaMargin().setLeft(0);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-23
      • 2017-04-24
      相关资源
      最近更新 更多