2015-09-04 59 views
0

可否請您告訴我刪除標籤y軸標籤。我使用融合庫做一個簡單的圖表。 http://www.fusioncharts.com/dev/chart-attributes.html?chart=area2d 我看到一些y軸標籤0 $,4 $,12 $ ..等我想刪除該標籤。我需要顯示圖表所示,如圖所示[![enter image description here] [1 ]] [1] http://jsfiddle.net/Tu57h/135/如何去除圖表中的y軸標籤?

我們可以在圖像中顯示這個右側嗎?

這裏是我的代碼 http://jsfiddle.net/Tu57h/135/

FusionCharts.ready(function() { 
    var salesChart = new FusionCharts({ 
     type: 'msarea', 
     renderAt: 'chart-container', 
     width: '450', 
     height: '300', 
     dataFormat: 'json', 
     dataSource: { 
      "chart": { 
       "caption": "Sales of Liquor", 
       "subCaption": "Previous week vs current week", 
       "xAxisName": "Day", 
       "numberPrefix": "$", 
       "paletteColors": "#0075c2,#1aaf5d", 
       "bgColor": "#ffffff", 
       "showBorder": "0", 
       "showCanvasBorder": "0", 
       "plotBorderAlpha": "10", 
       "usePlotGradientColor": "0", 
       "legendBorderAlpha": "0", 
       "legendShadow": "0", 
       "plotFillAlpha": "60", 
       "showXAxisLine": "1", 
       "axisLineAlpha": "25",     
       "showValues": "0", 
       "captionFontSize": "14", 
       "subcaptionFontSize": "14", 
       "subcaptionFontBold": "0", 
       "divlineColor": "#999999",     
       "divLineIsDashed": "1", 
       "divLineDashLen": "1", 
       "divLineGapLen": "1", 
       "showAlternateHGridColor": "0", 
       "toolTipColor": "#ffffff", 
       "toolTipBorderThickness": "0", 
       "toolTipBgColor": "#000000", 
       "toolTipBgAlpha": "80", 
       "toolTipBorderRadius": "2", 
       "toolTipPadding": "5", 
      }, 

      "categories": [ 
       { 
        "category": [ 
         { 
          "label": "jan 2015" 
         }, 
         { 
          "label": "feb 2015" 
         }, 
         { 
          "label": "mar 2015" 
         }, 
         { 
          "label": "may 2015" 
         }, 
         { 
          "label": "jun 2015" 
         }, 
         { 
          "label": "jul 2015" 
         }, 
         { 
          "label": "aug 2015" 
         },{ 
          "label": "sep 2015" 
         },{ 
          "label": "oct 2015" 
         } 
         ,{ 
          "label": "nov 2015" 
         },{ 
          "label": "dec 2015" 
         } 
        ] 
       } 
      ], 

      "dataset": [ 
       { 
        "seriesname": "Previous Week", 
        "data": [ 
         { 
          "value": "13000" 
         }, 
         { 
          "value": "14500" 
         }, 
         { 
          "value": "13500" 
         }, 
         { 
          "value": "15000" 
         }, 
         { 
          "value": "15500" 
         }, 
         { 
          "value": "17650" 
         }, 
         { 
          "value": "19500" 
         } 
        ] 
       } 
      ] 
     } 
    }) 
    .render(); 
}); 
+0

你試過設置'showYAxisValues ='0''? – Sushil

回答

0

圖像右側顯示的是趨勢線。您可以在圖表設置中刪除與showYAxisValues: "0" y軸的標籤,並用添加趨勢線:這裏

"trendlines": [ 
    { 
    "line": [ 
     { 
      "startvalue": "12000", 
      "color": "#1aaf5d", 
      "valueOnRight": "1", 
      "displayvalue": "$12K" 
     } 
    ] 
    } 
] 

小提琴http://jsfiddle.net/Tu57h/138/

-1

我不知道,如果API提供這樣的功能。但是,要隱藏y軸標籤,您可以定位由API創建的DOM部分並隱藏它。

setTimeout(function() { 
     $('#chart-container .fusioncharts-yaxis-0-gridlabels').eq(0).hide(); 
    }, 50); 

小提琴:http://jsfiddle.net/Tu57h/137/(我無法得到它工作的jsfiddle但本地計算機上運行時,它工作正常)。