Cassie Mod

Cassie Mod

  • NA
  • 488
  • 69.9k

rotation legend donut chart not working

Feb 9 2016 5:01 AM
HI,
 
I was wundering. I'm using a donut chart from Kendo UI. Wich works fine. However i want to rotate the legend. Is this possible ? and how can i do it ? everything i trie doesn't seem to work. anyone got some idea?? thnx
 
Code:
 
  1. <script type="text/javascript">  
  2.     $(document).ready(function () {  
  3.   
  4.         var collectors = [{  
  5.             "source""Failed",   // this text should be rotated 90 degreees  
  6.             "ammount": @Model.CollectorStatus.Count(c => !c.BatchCompleted.Value),  
  7.         }, {  
  8.             "source""Completed",     // this text should be rotated 90 degrees  
  9.             "ammount": @Model.CollectorStatus.Count(c => c.BatchCompleted.Value),  
  10.         }];  
  11.   
  12.         $("#collectorstatistics").kendoChart({  
  13.             title: {  
  14.                 position: "top",  
  15.                 text: "Collectors",  
  16.             },  
  17.             legend: {  
  18.                 position: "bottom",  
  19.                 // orientation: "vertical"  // doesn't work  
  20.                 // rotation: 90 // doesn't work  
  21.                 // rotation: -90 or -45 or 45  // doesn't work  
  22.                 //labels : { rotation: 90}  // doesn't work  
  23.             },  
  24.             dataSource: {  
  25.                 data: collectors  
  26.             },  
  27.             series: [{  
  28.                 type: "donut",  
  29.                 field: "ammount",  
  30.                 categoryField: "source"
  31.                 // rotation: 90    // doesn't work asswell  
  32.             }],  
  33.             chartArea: {  
  34.                 background: "none",  
  35.             },  
  36.             tooltip: {  
  37.                 visible: true,  
  38.                 template"${ category } - ${ value } Collectors"  
  39.             }  
  40.         });  
 Never Mind.
I got it working, but it looks really crap, so i deleted it again.
Here is my code for if someone wants to use it.
 
Code:
  1. <script type="text/javascript">  
  2.     $(document).ready(function () {  
  3.   
  4.         var collectors = [{  
  5.             "source""Failed",  
  6.             "ammount": @Model.CollectorStatus.Count(c => !c.BatchCompleted.Value),  
  7.         }, {  
  8.             "source""Completed",  
  9.             "ammount": @Model.CollectorStatus.Count(c => c.BatchCompleted.Value),  
  10.         }];  
  11.   
  12.         $("#collectorstatistics").kendoChart({  
  13.             title: {  
  14.                 position: "top",  
  15.                 text: "Collectors",  
  16.             },  
  17.             legend: {  
  18.                 position: "bottom",  
  19.                 // this doesn't look nice so i removed it again  
  20.                 //labels:{                 
  21.                 //    rotation: 90  
  22.                 //}  
  23.             },  
  24.             dataSource: {  
  25.                 data: collectors  
  26.             },  
  27.             series: [{  
  28.                 type: "donut",  
  29.                 field: "ammount",  
  30.                 categoryField: "source"  
  31.             }],  
  32.             chartArea: {  
  33.                 background: "none",  
  34.             },  
  35.             tooltip: {  
  36.                 visible: true,  
  37.                 template"${ category } - ${ value } Collectors"  
  38.             }  
  39.         });  
 

Answers (1)