【问题标题】:How to make bars rounded without the glass effect on Fusion Chart?如何在 Fusion Chart 上使条形变圆而没有玻璃效果?
【发布时间】:2018-11-26 11:06:01
【问题描述】:

目的是对图表条应用边框半径效果。 我发现的只是这个圆边的例子。

https://www.fusioncharts.com/dev/chart-guide/chart-configurations/data-plot#round-edges-7

但是,它在应用时会产生玻璃效果。 如何拥有玻璃效果,只保持圆形效果?

【问题讨论】:

    标签: fusioncharts


    【解决方案1】:

    FusionCharts 不支持柱形图的圆边,但是,您可以使用弧形注释形状并创建圆角,但请注意注释本质上是静态的,下面是示例图表:

     FusionCharts.ready(function() {
      var salesChart = new FusionCharts({
          type: 'MSColumn2D',
          renderAt: 'chart-container',
          width: '600',
          height: '400',
          dataFormat: 'json',
          dataSource: {
            "chart": {
              "caption": "Sales report of Apple products",
              "subcaption": "In Billion $",
              "yaxismaxvalue": "250",
              "decimals": "0",
              "numberprefix": "$",
              "numbersuffix": "B",
              "placevaluesinside": "1",
              "paletteColors": "#FF0000,#00FF00,#FFFF00",
              "divlinealpha": "56",
              "plotfillalpha": "100",
              "plotSpacePercent": "47",
              "crossLineColor": "#cc3300",
              "crossLineAlpha": "100",
              "theme": "zune"
            },
            "annotations": {
              "showbelow": "1",
              "groups": [{
                "id": "transarc",
                "items": [{
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#FF0000",
                    "alpha": "100",
                    "x": "$dataset.0.set.0.x",
                    "y": "$dataset.0.set.0.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  }, {
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#FF0000",
                    "alpha": "100",
                    "x": "$dataset.0.set.1.x",
                    "y": "$dataset.0.set.1.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  }, {
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#FF0000",
                    "alpha": "100",
                    "x": "$dataset.0.set.2.x",
                    "y": "$dataset.0.set.2.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  },
                  {
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#00FF00",
                    "alpha": "100",
                    "x": "$dataset.1.set.0.x",
                    "y": "$dataset.1.set.0.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  }, {
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#00FF00",
                    "alpha": "100",
                    "x": "$dataset.1.set.1.x",
                    "y": "$dataset.1.set.1.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  }, {
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#00FF00",
                    "alpha": "100",
                    "x": "$dataset.1.set.2.x",
                    "y": "$dataset.1.set.2.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  },
                  {
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#FFFF00",
                    "alpha": "100",
                    "x": "$dataset.2.set.0.x",
                    "y": "$dataset.2.set.0.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  }, {
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#FFFF00",
                    "alpha": "100",
                    "x": "$dataset.2.set.1.x",
                    "y": "$dataset.2.set.1.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  }, {
                    "type": "arc",
                    "radius": "16",
                    "borderColor": "#FFFFFF",
                    "innerRadius": "0",
                    "color": "#FFFF00",
                    "alpha": "100",
                    "x": "$dataset.2.set.2.x",
                    "y": "$dataset.2.set.2.STARTY+2",
                    "startangle": "0",
                    "endangle": "180"
                  }
                ]
              }]
            },
            "categories": [{
              "category": [{
                  "label": "2012"
                },
                {
                  "label": "2013"
                },
                {
                  "label": "2014"
                }
              ]
            }],
            "dataset": [{
                "seriesname": "iPod",
                "data": [{
                    "value": "42.63"
                  },
                  {
                    "value": "35.16"
                  },
                  {
                    "value": "26.38"
                  }
                ]
              },
              {
                "seriesname": "iPhone",
                "data": [{
                    "value": "125.04"
                  },
                  {
                    "value": "150.26"
                  },
                  {
                    "value": "169.22"
                  }
                ]
              },
              {
                "seriesname": "iPad",
                "data": [{
                    "value": "58.31"
                  },
                  {
                    "value": "71.04"
                  },
                  {
                    "value": "67.99"
                  }
                ]
              }
            ]
          }
        })
        .render();
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-26
      • 2020-02-03
      相关资源
      最近更新 更多