amcharts问题用同步轴填充柱形图的条形

时间:2018-05-26 12:34:33

标签: jquery amcharts

我有以下jsfiddle示例: jsfiddle 使用以下js:

var chart = AmCharts.makeChart("chartdiv", {
  "type": "serial",
  "legend": {
    "useGraphSettings": true
  },
  "dataProvider": chartData,
  "valueAxes": [{
    "id": "v1",
    "axisColor": "#FF6600",
    "axisThickness": 5,
    "gridAlpha": 0.1,
    "axisAlpha": 1
  }, {
    "id": "v2",
    "axisColor": "#FCD202",
    "axisThickness": 5,
    "gridAlpha": 0,
    "axisAlpha": 1,
    "position": "right",
    "synchronizeWith": "v1",
    "synchronizationMultiplier": 5
  }],
  "graphs": [{
    "valueAxis": "v1",
    "type": "column",
     "fillColors": "#008800",
    "title": "red line",
    "valueField": "visits"
  }, 
 ...

我希望参数" fillColors":"#008800",用绿色填充将图表的列更改为绿色,但是我没有达到此结果。他们只使用这个红色轮廓。

有什么建议吗?

1 个答案:

答案 0 :(得分:2)

您应该设置"fillAlphas"。例如,我将其设置为1. working jsfiddle

  "graphs": [{
    "valueAxis": "v1",
    "type": "column",
     "fillColors": "#008800",
     "fillAlphas":1, /* here i set it */
    "title": "red line",
    "valueField": "visits"
  }, {
    "valueAxis": "v2",
    "type": "smoothedLine",
    "lineColor": "#c2c2c2",

    "bulletBorderThickness": 1,
    "hideBulletsCount": 30,
    "title": "yellow line",
    "valueField": "hits",
    "fillAlphas": 0
  }],