2013-12-18 3 views
0

저는 파이 조각이 두 개인 원형 차트를 만듭니다. 채우기 속성과 색을 추가하여 전체 원형 차트를 원하는 색을 말할 수는 있지만 원형 차트 한 장을 파란색으로 만들고 다른 조각을 녹색으로 만들고 싶습니다. 독특한 dojox 원형 차트의 채우기 색

majpieChart = new Chart("majorPieChart"); 
     majpieChart.setTheme(Claro).addPlot("default", { 
      type: "Pie", 
      font: "normal normal 10pt Tahoma", 
      fontColor: "#1c3923", 
      labelWiring: "#1c3923", 
      radius: 100, 
      labelStyle: "columns", 
      htmlLabels: true, 
      startAngle: -10, 
      fill : {colors: [ {offset: 0, color: "#00ff78"}, 
           {offset: 1, color: "#7f0043"} 
          ] 
        } 
     }).addSeries("Major",majBreak); 

나는 그것이 나에게 위의 요청 같은 효과를 줄 것입니다하지만이 졸졸 흐르는 색상을 찾고 효과를 더주는 희망이 새로운 채우기를 시도했다. 이견있는 사람?

답변

0

자신 만의 간단한 테마를 만들 수 있습니다.이 테마는 단순한 테마입니다. 그라디언트를 원한다면 더 복잡한 테마를 만들어야합니다. http://dojotoolkit.org/documentation/tutorials/1.8/charting/

require([ 
    "dojox/charting/Chart", 
    "dojox/charting/themes/Claro", "dojox/charting/plot2d/Pie", 
    "dojox/charting/SimpleTheme", 
    "dojo/domReady!"], function (Chart, Claro, Pie, theme) { 
    chartData = [{ 
     x: 1, 
     y: 19021 
    }, { 
     x: 1, 
     y: 12837 
    }, ]; 
    majpieChart = new Chart("majorPieChart"); 
    majpieChart.setTheme(new theme({ 
     colors: [ 
      "#00ff78", 
      "#7f0043", 
      "#8ecfb0", 
      "#f8acac", 
      "#cc4482"] 
    })).addPlot("default", { 
     type: "Pie", 
     font: "normal normal 10pt Tahoma", 
     fontColor: "#1c3923", 
     labelWiring: "#1c3923", 
     radius: 100, 
     labelStyle: "columns", 
     htmlLabels: true, 
     startAngle: -10, 
    }).addSeries("Major", chartData); 

    majpieChart.render(); 
}); 

바이올린 :: 또한 차트 데이터로 채우기 색상을 추가 할 수 있습니다 http://jsfiddle.net/YL2Mf/

UPDATE :

chartData = [{ 
    x: 1, 
    y: 19021, 
    fill:"green" 
}, { 
    x: 1, 
    y: 12837, 
    fill:"yellow" 
}, ]; 

바이올린 :: http://jsfiddle.net/theinnkeeper/a56Y9/1/

+0

큰 일했다, 감사 – user2994297